/* WebshotNinja — DA : navy du costume, rouge de la ceinture, or du katana, fond clair */
:root {
  --ink: #222B3C;        /* navy costume */
  --ink-deep: #161D2B;
  --red: #E03131;        /* ceinture */
  --red-dark: #B82424;
  --gold: #F5B81F;       /* poignée katana */
  --gold-dark: #D99E0B;
  --paper: #F2F4F8;      /* fond clair */
  --card: #FFFFFF;
  --line: #DDE3EC;
  --muted: #5B6678;
  --ok: #2F9E44;
  --display: 'Chakra Petch', sans-serif;
  --body: 'Inter', system-ui, sans-serif;
  --mono: 'JetBrains Mono', monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; animation: none !important; } }

body { font-family: var(--body); background: var(--paper); color: var(--ink); line-height: 1.6; }
.container { max-width: 1080px; margin: 0 auto; padding: 0 24px; }
a { color: var(--red); }
h1, h2, h3 { font-family: var(--display); line-height: 1.15; }

/* ===== Boutons ===== */
.btn { display: inline-block; font-family: var(--display); font-weight: 700; font-size: 15px;
  padding: 10px 22px; border-radius: 8px; border: 2px solid transparent; cursor: pointer;
  text-decoration: none; transition: transform .12s, box-shadow .12s; }
.btn:hover { transform: translateY(-1px); }
.btn:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.btn-primary { background: var(--ink); color: #fff; }
.btn-primary:hover { background: var(--ink-deep); }
.btn-gold { background: var(--gold); color: var(--ink-deep); box-shadow: 0 4px 14px rgba(245,184,31,.35); }
.btn-gold:hover { background: var(--gold-dark); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--ink); }
.btn-lg { font-size: 17px; padding: 13px 30px; }
.btn-sm { font-size: 13px; padding: 6px 14px; }
.btn-block { width: 100%; }
.link-btn { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 13px;
  text-decoration: underline; font-family: var(--body); }
.link-btn.danger:hover { color: var(--red); }
.inline-form { display: inline; }

/* ===== Nav ===== */
.nav { background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 50; }
.nav-inner { display: flex; align-items: center; gap: 28px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink);
  font-family: var(--display); font-weight: 700; font-size: 21px; }
.brand em { color: var(--red); font-style: normal; }
.brand-mark { height: 38px; transform: scale(1.0); }
.nav-links { display: flex; gap: 20px; }
.nav-links a { color: var(--ink); text-decoration: none; font-weight: 500; font-size: 15px;
  padding: 4px 2px; border-bottom: 2px solid transparent; }
.nav-links a:hover, .nav-links a.active { border-bottom-color: var(--red); }
.nav-actions { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.lang-switch a { color: var(--muted); text-decoration: none; font-size: 12.5px; font-weight: 600; padding: 2px 4px; }
.lang-switch a.active { color: var(--ink); border-bottom: 2px solid var(--gold); }

/* ===== Hero ===== */
.hero { padding: 72px 0 56px; background: var(--card); }
.hero-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 40px; align-items: center; }
.hero h1 { font-size: clamp(34px, 5vw, 52px); letter-spacing: -.5px; }
.hero-sub { margin-top: 18px; font-size: 19px; color: var(--muted); max-width: 54ch; }
.hero-code { margin-top: 26px; background: var(--ink-deep); border-radius: 10px; padding: 14px 18px;
  border-left: 4px solid var(--gold); overflow-x: auto; }
.hero-code code { font-family: var(--mono); font-size: 14px; color: #E8EDF5; white-space: nowrap; }
.hero-mascot { width: 100%; max-width: 340px; justify-self: center;
  filter: drop-shadow(0 16px 32px rgba(34,43,60,.18)); }

/* ===== Slash diagonal (signature) ===== */
.slash-top { position: relative; }
.slash-top::before { content: ''; display: block; height: 56px; margin-top: -56px;
  background: linear-gradient(to bottom right, transparent 49.6%, var(--ink) 50%); pointer-events: none; }

/* ===== Dojo (démo) ===== */
.dojo { background: var(--ink); color: #fff; padding: 56px 0 64px; }
.dojo-title { font-size: 28px; margin-bottom: 24px; }
.dojo-title::after { content: ''; display: block; width: 64px; height: 4px; background: var(--red);
  margin-top: 10px; transform: skewX(-30deg); }
.dojo-form { background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.12);
  border-radius: 14px; padding: 22px; }
.dojo-row { display: flex; gap: 12px; }
.dojo-row input[type="url"] { flex: 1; padding: 13px 16px; border-radius: 8px; border: 2px solid transparent;
  font-size: 16px; font-family: var(--mono); }
.dojo-row input[type="url"]:focus { outline: none; border-color: var(--gold); }
.dojo-options { display: flex; flex-wrap: wrap; gap: 20px; margin-top: 16px; font-size: 14px;
  color: #C6CDDA; align-items: center; }
.dojo-options label { display: flex; align-items: center; gap: 8px; }
.dojo-options input[type="number"], .dojo-options select { width: 86px; padding: 6px 8px;
  border-radius: 6px; border: 1px solid rgba(255,255,255,.2); background: rgba(255,255,255,.1);
  color: #fff; font-family: var(--mono); }
.dojo-options select { width: auto; }
.dojo-options option { color: var(--ink); }
.check input { width: 16px; height: 16px; accent-color: var(--red); }
.dojo-result { margin-top: 28px; text-align: center; }
.dojo-frame { background: #fff; border-radius: 12px; overflow: hidden; box-shadow: 0 18px 48px rgba(0,0,0,.4);
  max-width: 860px; margin: 0 auto 16px; }
.dojo-frame-bar { display: flex; gap: 6px; padding: 10px 14px; background: #E9ECF2; }
.dojo-frame-bar span { width: 11px; height: 11px; border-radius: 50%; background: #C3CAD6; }
.dojo-frame-bar span:first-child { background: var(--red); }
.dojo-frame-bar span:nth-child(2) { background: var(--gold); }
.dojo-frame img { display: block; width: 100%; max-height: 560px; object-fit: contain; object-position: top; }
.dojo .btn-ghost { color: #fff; border-color: rgba(255,255,255,.3); }
.dojo .btn-ghost:hover { border-color: var(--gold); }
.dojo-error { margin-top: 18px; color: #FFB3B3; font-weight: 500; }

/* ===== Features ===== */
.features { padding: 64px 0; }
.features-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 28px; }
.feature { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 26px;
  transition: box-shadow .15s, transform .15s; }
.feature:hover { box-shadow: 0 10px 28px rgba(34,43,60,.1); transform: translateY(-2px); }
.feature-icon { width: 84px; height: 84px; object-fit: contain; border-radius: 50%; padding: 8px;
  background: var(--paper); margin-bottom: 14px; }
.feature h3 { font-size: 18px; margin-bottom: 8px; }
.feature p { color: var(--muted); font-size: 15px; }

/* ===== CTA ===== */
.cta { background: var(--ink); color: #fff; padding: 56px 0 72px; }
.cta-inner { text-align: center; }
.cta h2 { font-size: clamp(26px, 4vw, 36px); }
.cta p { margin: 14px auto 26px; color: #C6CDDA; max-width: 56ch; }

/* ===== Pages génériques ===== */
.page { padding: 56px 24px 72px; }
.page-narrow { max-width: 800px; }
.page-title { font-size: clamp(28px, 4vw, 40px); }
.page-sub { color: var(--muted); margin-top: 10px; font-size: 17px; max-width: 64ch; }
.page h2 { margin: 36px 0 12px; font-size: 22px; }
.page h3 { margin: 22px 0 8px; font-size: 16px; }

/* ===== Pricing ===== */
.plans { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-top: 40px; }
.plan { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 26px 22px;
  display: flex; flex-direction: column; }
.plan-featured { border: 2px solid var(--gold); position: relative; box-shadow: 0 12px 32px rgba(245,184,31,.18); }
.plan h2 { font-size: 19px; margin: 0; }
.plan-price { font-family: var(--display); font-weight: 700; font-size: 34px; margin: 12px 0 2px; }
.plan-price span { font-size: 15px; color: var(--muted); font-weight: 400; }
.plan-quota { color: var(--red); font-size: 15px; }
.plan-desc { color: var(--muted); font-size: 13.5px; margin: 10px 0 14px; min-height: 42px; }
.plan-features { list-style: none; margin-bottom: 20px; flex: 1; }
.plan-features li { font-size: 13.5px; padding: 5px 0 5px 22px; position: relative; }
.plan-features li::before { content: '✓'; position: absolute; left: 0; color: var(--ok); font-weight: 700; }
.plan .btn { text-align: center; }
.plan-current { text-align: center; cursor: default; }
.payment-note { margin-top: 28px; text-align: center; color: var(--muted); font-size: 14px; }

/* ===== Docs / tables / code ===== */
.code-block { background: var(--ink-deep); border-radius: 10px; padding: 16px 18px; overflow-x: auto;
  border-left: 4px solid var(--red); }
.code-block code { font-family: var(--mono); font-size: 13.5px; color: #E8EDF5; }
.params, .history { width: 100%; border-collapse: collapse; margin-top: 8px; background: var(--card);
  border: 1px solid var(--line); border-radius: 10px; overflow: hidden; font-size: 14px; }
.params th, .params td, .history th, .history td { padding: 10px 14px; text-align: left;
  border-bottom: 1px solid var(--line); }
.params th, .history th { background: var(--paper); font-family: var(--display); font-size: 13px; }
.params code { font-family: var(--mono); color: var(--red); font-size: 13px; }

/* ===== FAQ ===== */
.faq-list { margin-top: 32px; }
.faq-item { background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  margin-bottom: 12px; padding: 0 20px; }
.faq-item summary { font-family: var(--display); font-weight: 600; font-size: 16px; padding: 16px 0;
  cursor: pointer; list-style: none; position: relative; padding-right: 30px; }
.faq-item summary::after { content: '+'; position: absolute; right: 4px; color: var(--red);
  font-size: 22px; line-height: 1; }
.faq-item[open] summary::after { content: '–'; }
.faq-item p { padding-bottom: 16px; color: var(--muted); }

/* ===== Auth ===== */
.auth-page { display: flex; justify-content: center; }
.auth-card { background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  padding: 36px; width: 100%; max-width: 420px; }
.auth-card h1 { font-size: 26px; }
.auth-sub { color: var(--muted); margin-top: 6px; font-size: 14.5px; }
.auth-card form { margin-top: 22px; display: flex; flex-direction: column; gap: 16px; }
.auth-card label { font-size: 14px; font-weight: 600; display: flex; flex-direction: column; gap: 6px; }
.auth-card input { padding: 11px 14px; border: 1.5px solid var(--line); border-radius: 8px; font-size: 15px; }
.auth-card input:focus { outline: none; border-color: var(--ink); }
.auth-card small { color: var(--muted); font-weight: 400; }
.auth-alt { margin-top: 18px; font-size: 14px; color: var(--muted); }
.form-error { background: #FDECEC; color: var(--red-dark); border: 1px solid #F5C2C2;
  border-radius: 8px; padding: 10px 14px; font-size: 14px; margin-top: 14px; }

/* ===== Dashboard ===== */
.flash { border-radius: 10px; padding: 12px 16px; margin: 18px 0; font-size: 14.5px; }
.flash-ok { background: #E7F6EC; color: #1E7B33; border: 1px solid #BCE5C8; }
.flash-warn { background: #FFF6E0; color: #8A6400; border: 1px solid #F0DFA8; }
.dash-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin: 28px 0 20px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 24px;
  margin-bottom: 20px; }
.card h2 { font-size: 17px; margin-bottom: 14px; }
.key-row { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; }
.key-row code { flex: 1; font-family: var(--mono); font-size: 13px; background: var(--paper);
  border: 1px dashed var(--line); border-radius: 8px; padding: 10px 12px; overflow-x: auto;
  white-space: nowrap; }
.usage-big { font-size: 15px; }
.usage-big strong { font-family: var(--display); font-size: 30px; color: var(--ink); }
.usage-bar { height: 10px; background: var(--paper); border-radius: 6px; margin: 12px 0; overflow: hidden; }
.usage-fill { height: 100%; background: linear-gradient(90deg, var(--gold), var(--red)); border-radius: 6px;
  transition: width .4s; }
.usage-hot { background: var(--red); }
.usage-plan { font-size: 14px; color: var(--muted); }
.history .cell-url { font-family: var(--mono); font-size: 12.5px; }
.badge { font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 99px; }
.badge-ok { background: #E7F6EC; color: #1E7B33; }
.badge-cached { background: #EAF1FE; color: #2856B6; }
.badge-error { background: #FDECEC; color: var(--red-dark); }
.muted { color: var(--muted); }

/* ===== Footer ===== */
.footer { background: var(--ink-deep); color: #B7C0CF; padding: 40px 0; margin-top: 0; }
.footer-inner { display: flex; flex-wrap: wrap; gap: 28px; align-items: flex-start; }
.footer .brand-text { font-family: var(--display); font-weight: 700; font-size: 19px; color: #fff; }
.footer .brand-text em { color: var(--red); font-style: normal; }
.footer-brand p { font-size: 13.5px; margin-top: 6px; }
.footer-links { display: flex; gap: 18px; flex-wrap: wrap; margin-left: auto; }
.footer-links a { color: #B7C0CF; text-decoration: none; font-size: 14px; }
.footer-links a:hover { color: var(--gold); }
.footer-copy { width: 100%; font-size: 12.5px; color: #6B7689; }

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; text-align: center; }
  .hero-sub, .hero-code { margin-left: auto; margin-right: auto; }
  .hero-mascot { max-width: 240px; order: -1; }
  .features-grid { grid-template-columns: 1fr; }
  .plans { grid-template-columns: repeat(2, 1fr); }
  .dash-grid { grid-template-columns: 1fr; }
  .nav-links { display: none; }
}
@media (max-width: 560px) {
  .plans { grid-template-columns: 1fr; }
  .dojo-row { flex-direction: column; }
}

/* ===== Espace client (sidebar) ===== */
.page-dash { padding: 36px 0 64px; }
.dash-layout { display: grid; grid-template-columns: 230px 1fr; gap: 28px; align-items: start; }
.dash-side { background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 14px; position: sticky; top: 84px; }
.dash-side nav { display: flex; flex-direction: column; gap: 2px; }
.dash-side nav a { padding: 10px 12px; border-radius: 8px; text-decoration: none; color: var(--ink);
  font-size: 14.5px; font-weight: 500; }
.dash-side nav a:hover { background: var(--paper); }
.dash-side nav a.active { background: var(--ink); color: #fff; }
.dash-side-res { margin-top: 18px; padding: 12px; border-top: 1px solid var(--line); }
.dash-side-res p { font-size: 11.5px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted);
  margin-bottom: 8px; font-weight: 600; }
.dash-side-res a { display: block; font-size: 13.5px; color: var(--muted); text-decoration: none; padding: 3px 0; }
.dash-side-res a:hover { color: var(--red); }
.dash-title { font-size: 26px; margin-bottom: 18px; }
.small { font-size: 13px; }
.token-add { display: flex; gap: 10px; margin-bottom: 18px; }
.token-add input { flex: 1; max-width: 320px; padding: 9px 12px; border: 1.5px solid var(--line);
  border-radius: 8px; font-size: 14px; }
.token-code { font-family: var(--mono); font-size: 12px; background: var(--paper); padding: 4px 8px;
  border-radius: 6px; border: 1px dashed var(--line); }
.tokens-table td { vertical-align: middle; }
.chart { display: flex; align-items: flex-end; gap: 3px; height: 220px; padding: 10px 0 4px; }
.chart-col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center;
  height: 100%; min-width: 0; }
.chart-bar { width: 100%; background: linear-gradient(180deg, var(--red), var(--red-dark));
  border-radius: 4px 4px 0 0; min-height: 2px; transition: height .3s; }
.chart-col:hover .chart-bar { background: var(--gold); }
.chart-day { font-size: 9.5px; color: var(--muted); margin-top: 5px; font-family: var(--mono); }
.notif-form { display: flex; flex-direction: column; gap: 16px; align-items: flex-start; }
.check-row { display: flex; gap: 10px; align-items: baseline; font-size: 14.5px; }
.check-row input[type="checkbox"] { width: 17px; height: 17px; accent-color: var(--red); position: relative; top: 3px; }
.inline-num { width: 58px; padding: 4px 8px; border: 1.5px solid var(--line); border-radius: 6px;
  font-family: var(--mono); text-align: center; }
.settings-form { display: flex; flex-direction: column; gap: 14px; max-width: 420px; }
.settings-form label { font-size: 14px; font-weight: 600; display: flex; flex-direction: column; gap: 5px; }
.settings-form input, .settings-form select { padding: 10px 12px; border: 1.5px solid var(--line);
  border-radius: 8px; font-size: 14.5px; font-weight: 400; }
.settings-form button { align-self: flex-start; }
.card-danger { border-color: #F5C2C2; }
.card-danger h2 { color: var(--red-dark); }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { background: var(--red-dark); }
.amount-neg { color: var(--red-dark); font-weight: 600; }
.plans-dash { grid-template-columns: repeat(4, 1fr); margin-top: 8px; }
.plans-dash .plan { padding: 20px 16px; }
@media (max-width: 900px) {
  .dash-layout { grid-template-columns: 1fr; }
  .dash-side { position: static; }
  .dash-side nav { flex-direction: row; flex-wrap: wrap; }
  .plans-dash { grid-template-columns: repeat(2, 1fr); }
}

/* Fix débordement grid (tokens longs) */
.dash-main { min-width: 0; }
.dash-grid > .card { min-width: 0; }
.card { overflow: hidden; }
.code-block { max-width: 100%; }
.tokens-table .cell-url { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
