/* Base */
:root {
  --bg: #070b16;
  --bg-soft: #0a1022;
  --panel: rgba(255, 255, 255, 0.04);
  --panel-strong: rgba(255, 255, 255, 0.08);
  --text: #e6f1ff;
  --muted: #9fb0c8;
  --primary: #00ffa3; /* neon green */
  --secondary: #00e5ff; /* cyan */
  --warning: #ffd166;
  --danger: #ff5c8a;
  --glow: 0 0 24px rgba(0, 255, 163, 0.35);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  color: var(--text);
  background: radial-gradient(1200px 600px at 80% -10%, rgba(0, 229, 255, 0.06), transparent),
              radial-gradient(1000px 600px at -10% 10%, rgba(0, 255, 163, 0.06), transparent),
              var(--bg);
}

/***** Background grid + particles *****/
.bg.fx-grid {
  position: fixed; inset: 0; pointer-events: none; z-index: -1;
  background-image:
    linear-gradient(to right, rgba(255,255,255,0.05) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,0.05) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: radial-gradient(1000px 600px at 50% 0%, rgba(0,0,0,0.9), rgba(0,0,0,0.2));
}

/***** Header *****/
.site-header {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 28px; backdrop-filter: saturate(140%) blur(10px);
  background: linear-gradient(to bottom, rgba(10,16,34,0.85), rgba(10,16,34,0.55));
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); font-weight: 700; }
.brand .brand-name { letter-spacing: 0.3px; }
.brand .logo svg { filter: drop-shadow(0 0 18px rgba(0, 255, 163, 0.35)); }

.nav { display: flex; align-items: center; gap: 16px; }
.nav a { color: var(--muted); text-decoration: none; font-weight: 600; }
.nav a:hover { color: var(--text); }

/***** Buttons *****/
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 16px; border-radius: 10px; text-decoration: none; font-weight: 700;
  transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease;
  border: 1px solid transparent; cursor: pointer; color: var(--text);
}
.btn:active { transform: translateY(1px); }
.btn--primary { background: linear-gradient(180deg, rgba(0,255,163,0.2), rgba(0,255,163,0.06)); border-color: rgba(0,255,163,0.35); box-shadow: var(--glow); color: #0b1b14; }
.btn--primary:hover { background: rgba(0,255,163,0.28); color: #07130f; }
.btn--ghost { background: rgba(255,255,255,0.04); border-color: rgba(255,255,255,0.08); color: var(--text); }
.btn--ghost:hover { background: rgba(255,255,255,0.08); }

/***** Hero *****/
.hero { display: grid; grid-template-columns: 1.1fr 1fr; gap: 40px; align-items: center; padding: 64px 28px 32px; }
.hero__content h1 { font-size: clamp(28px, 4vw, 48px); line-height: 1.1; margin: 0 0 12px; font-weight: 800; }
.hero__content .accent { color: var(--primary); text-shadow: 0 0 16px rgba(0,255,163,0.35); }
.subtitle { color: var(--muted); font-size: 16px; margin: 0 0 24px; max-width: 60ch; }

.scan-form { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; padding: 14px; border-radius: 14px; background: var(--panel); border: 1px solid rgba(255,255,255,0.08); width: min(580px, 100%); }
.scan-form input { height: 44px; padding: 0 12px; border-radius: 10px; background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1); color: var(--text); outline: none; transition: border-color 0.2s, background 0.2s; }
.scan-form input:focus { border-color: rgba(0,255,163,0.4); background: rgba(255,255,255,0.09); }
.scan-form input:disabled { opacity: 0.5; cursor: not-allowed; }
.scan-form .btn--primary:disabled { opacity: 0.6; cursor: not-allowed; box-shadow: none; transform: none; }
.scan-form input::placeholder { color: #8aa0b8; }
.scan-form .form-help { grid-column: 1 / -1; color: var(--muted); margin-top: 4px; }

.trust { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 999px; border: 1px solid rgba(255,255,255,0.08); background: rgba(255,255,255,0.04); color: var(--muted); font-weight: 600; }

.hero__visual { position: relative; min-height: 340px; }
.orb { position: absolute; border-radius: 999px; filter: blur(14px); opacity: 0.75; }
.orb--green { width: 160px; height: 160px; background: radial-gradient(circle at 30% 30%, rgba(0,255,163,0.9), transparent 60%); top: 10%; right: 14%; animation: float 7s ease-in-out infinite; }
.orb--cyan { width: 220px; height: 220px; background: radial-gradient(circle at 70% 70%, rgba(0,229,255,0.8), transparent 60%); bottom: 6%; left: 6%; animation: float 9s ease-in-out infinite reverse; }

.terminal { position: relative; background: rgba(2,6,18,0.9); border: 1px solid rgba(255,255,255,0.08); border-radius: 14px; overflow: hidden; box-shadow: 0 12px 40px rgba(0,0,0,0.5); }
.terminal__bar { display: flex; align-items: center; gap: 8px; padding: 10px 12px; background: linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.02)); border-bottom: 1px solid rgba(255,255,255,0.06); }
.terminal__bar .dot { width: 9px; height: 9px; border-radius: 50%; }
.terminal__bar .dot:nth-child(1) { background: #ff605c; }
.terminal__bar .dot:nth-child(2) { background: #ffbd44; }
.terminal__bar .dot:nth-child(3) { background: #00ca4e; }
.terminal__bar .title { margin-left: 8px; color: var(--muted); font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace; font-size: 12px; }
.terminal__body { margin: 0; padding: 14px 16px; font-size: 14px; color: var(--text); background: repeating-linear-gradient(transparent, transparent 28px, rgba(255,255,255,0.02) 28px, rgba(255,255,255,0.02) 29px); max-height: 320px; overflow-y: auto; scroll-behavior: smooth; }
.mono-green { color: var(--primary); }
.mono-yellow { color: var(--warning); }
.mono-dim { color: #6a7f98; }

/* mono-intense-red (terminal errors) */
.mono-intense-red { color: var(--danger); font-weight: 700; }

/* ─── Full Report Section ────────────────────────────────────────────────────── */
.report-section { padding: 40px 28px 64px; border-top: 1px solid rgba(255,255,255,0.06); }

/* Top header */
.report-top {
  display: flex; align-items: center; gap: 28px; flex-wrap: wrap;
  padding: 24px 28px; margin-bottom: 32px;
  background: var(--panel); border: 1px solid rgba(255,255,255,0.08); border-radius: 16px;
}

/* Grade ring */
.grade-block { display: flex; align-items: center; gap: 20px; }
.grade-ring-wrap { position: relative; width: 84px; height: 84px; flex-shrink: 0; }
.grade-ring-svg { width: 84px; height: 84px; transform: rotate(-90deg); }
.grade-ring-bg { fill: none; stroke: rgba(255,255,255,0.08); stroke-width: 5; }
.grade-ring-fill {
  fill: none; stroke: var(--primary); stroke-width: 5; stroke-linecap: round;
  stroke-dasharray: 213.6; stroke-dashoffset: 213.6;
  transition: stroke-dashoffset 1.4s cubic-bezier(0.4, 0, 0.2, 1), stroke 0.3s;
}
.grade-letter {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-size: 28px; font-weight: 800; font-family: "IBM Plex Mono", monospace;
  color: var(--primary); transition: color 0.3s;
}
.grade-info { min-width: 110px; }
.grade-score-num { font-size: 34px; font-weight: 800; font-family: "IBM Plex Mono", monospace; line-height: 1; }
.grade-max { font-size: 14px; color: var(--muted); font-weight: 400; }
.grade-label { color: var(--muted); font-size: 13px; margin-top: 4px; }

/* Meta */
.report-meta { margin-left: auto; text-align: right; }
.meta-target { font-family: "IBM Plex Mono", monospace; font-size: 14px; color: var(--text); margin-bottom: 8px; word-break: break-all; }
.meta-stats { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.meta-badge {
  padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 700;
  background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1); color: var(--muted);
}
.meta-badge--red    { background: rgba(255,92,138,0.15);  border-color: rgba(255,92,138,0.4);  color: #ff5c8a; }
.meta-badge--yellow { background: rgba(255,209,102,0.15); border-color: rgba(255,209,102,0.4); color: #ffd166; }
.meta-badge--green  { background: rgba(0,255,163,0.1);    border-color: rgba(0,255,163,0.3);   color: #00ffa3; }
.meta-badge--gray   { background: rgba(160,170,190,0.12); border-color: rgba(160,170,190,0.3); color: #a9b3c7; }

/* Section subtitle */
.report-sub {
  font-size: 18px; font-weight: 700; margin: 24px 0 14px; color: var(--text);
  display: flex; align-items: center; gap: 10px;
}
.improv-count {
  font-size: 12px; font-weight: 700; padding: 2px 9px; border-radius: 999px;
  background: rgba(255,92,138,0.15); border: 1px solid rgba(255,92,138,0.3); color: #ff5c8a;
}

/* Modules grid */
.modules-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(136px, 1fr));
  gap: 10px; margin-bottom: 8px;
}
.module-card {
  background: var(--panel); border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px; padding: 12px 14px;
  border-left: 3px solid transparent;
}
.module-card--ok    { border-left-color: rgba(0,255,163,0.5); }
.module-card--warn  { border-left-color: rgba(255,209,102,0.6); background: rgba(255,209,102,0.03); }
.module-card--fail  { border-left-color: rgba(255,92,138,0.65); background: rgba(255,92,138,0.04); }
.module-card--error { border-left-color: rgba(160,170,190,0.5); background: rgba(160,170,190,0.03); opacity: 0.85; }
.module-card__name {
  font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase;
  letter-spacing: 0.5px; margin-bottom: 6px; font-family: "IBM Plex Mono", monospace;
}
.module-card__status { font-size: 13px; font-weight: 700; }
.module-card__status--ok    { color: var(--primary); }
.module-card__status--warn  { color: var(--warning); }
.module-card__status--fail  { color: var(--danger); }
.module-card__status--error { color: #a9b3c7; }
.module-card__note { font-size: 11px; color: var(--muted); margin-top: 4px; line-height: 1.3; }

/* Improvement cards */
.improvements-list { display: flex; flex-direction: column; gap: 12px; }
.improv-card {
  background: var(--panel); border: 1px solid rgba(255,255,255,0.08);
  border-left: 4px solid transparent; border-radius: 14px; padding: 18px 20px;
}
.improv-card--critique { border-left-color: #ff5c8a; }
.improv-card--eleve    { border-left-color: #ff9a3c; }
.improv-card--moyen    { border-left-color: #ffd166; }
.improv-card--faible   { border-left-color: #6ab4cc; }

.improv-header {
  display: flex; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap;
}
.improv-severity {
  padding: 3px 9px; border-radius: 6px; font-size: 11px; font-weight: 800;
  text-transform: uppercase; letter-spacing: 0.5px; font-family: "IBM Plex Mono", monospace;
}
.improv-severity--critique { background: rgba(255,92,138,0.2);  color: #ff5c8a; border: 1px solid rgba(255,92,138,0.4); }
.improv-severity--eleve    { background: rgba(255,154,60,0.2);  color: #ff9a3c; border: 1px solid rgba(255,154,60,0.4); }
.improv-severity--moyen    { background: rgba(255,209,102,0.15);color: #ffd166; border: 1px solid rgba(255,209,102,0.35);}
.improv-severity--faible   { background: rgba(106,180,204,0.15);color: #8dc5d6; border: 1px solid rgba(106,180,204,0.3); }

.improv-title { font-size: 15px; font-weight: 700; color: var(--text); }
.improv-cvss  { margin-left: auto; font-family: "IBM Plex Mono", monospace; font-size: 12px; color: var(--muted); }
.improv-desc  { color: var(--muted); font-size: 14px; margin: 0 0 10px; line-height: 1.55; }

.improv-impact, .improv-fix {
  font-size: 13px; color: var(--text); border-radius: 8px;
  padding: 9px 13px; margin-bottom: 8px; line-height: 1.5;
}
.improv-impact {
  background: rgba(255,92,138,0.06); border: 1px solid rgba(255,92,138,0.18);
}
.improv-impact::before { content: '⚡ Impact : '; font-weight: 700; color: var(--danger); }
.improv-fix {
  background: rgba(0,255,163,0.05); border: 1px solid rgba(0,255,163,0.18);
}
.improv-fix::before { content: '✓ Fix : '; font-weight: 700; color: var(--primary); }

.improv-tools { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.tool-tag {
  font-size: 11px; padding: 2px 8px; border-radius: 4px;
  background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1);
  color: var(--muted); font-family: "IBM Plex Mono", monospace;
}

/* All-clear */
.all-clear {
  display: flex; align-items: center; gap: 16px; padding: 20px 24px; margin-top: 16px;
  border: 1px solid rgba(0,255,163,0.25); background: rgba(0,255,163,0.05); border-radius: 14px;
}
.all-clear-icon { font-size: 28px; color: var(--primary); font-weight: 800; }
.all-clear strong { color: var(--primary); font-size: 16px; display: block; }
.all-clear p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }

/* ─── Module card info button ──────────────────────────────────────────────── */
.module-card { position: relative; }

.info-btn {
  position: absolute; top: 8px; right: 8px;
  width: 20px; height: 20px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.07);
  color: var(--muted); font-size: 12px; font-style: italic;
  font-family: Georgia, serif; font-weight: 700;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  line-height: 1; padding: 0;
}
.info-btn:hover, .info-btn:focus-visible {
  background: rgba(0,229,255,0.18);
  color: var(--accent);
  border-color: rgba(0,229,255,0.45);
  outline: none;
}
.module-card--warn .info-btn:hover { background: rgba(255,209,102,0.15); color: var(--warning); border-color: rgba(255,209,102,0.4); }
.module-card--fail .info-btn:hover { background: rgba(255,92,138,0.15);  color: var(--danger);  border-color: rgba(255,92,138,0.4);  }

/* ─── Info modal ─────────────────────────────────────────────────────────── */
.info-modal {
  position: fixed; inset: 0; z-index: 900;
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.info-modal[hidden] { display: none !important; }
.info-modal__backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.72);
  backdrop-filter: blur(6px);
}
.info-modal__box {
  position: relative; z-index: 1;
  background: #0d1221; border: 1px solid rgba(255,255,255,0.14);
  border-radius: 18px; padding: 28px 28px 24px;
  max-width: 620px; width: 100%;
  max-height: 85vh; overflow-y: auto;
  box-shadow: 0 24px 64px rgba(0,0,0,0.6);
}
.info-modal__close {
  position: absolute; top: 14px; right: 16px;
  background: rgba(255,255,255,0.07); border: 1px solid rgba(255,255,255,0.14);
  color: var(--muted); border-radius: 8px;
  width: 28px; height: 28px; font-size: 13px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s, color 0.15s;
}
.info-modal__close:hover { background: rgba(255,92,138,0.15); color: var(--danger); border-color: rgba(255,92,138,0.4); }

.info-modal-header {
  display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap;
  padding-right: 36px;
}
.info-modal-title { font-size: 17px; font-weight: 700; color: var(--text); }
.info-modal-desc  { margin: 0 0 14px; color: var(--muted); font-size: 14px; line-height: 1.6; }

.info-code-block  { margin-bottom: 12px; }
.info-code-label  { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 4px; font-family: "IBM Plex Mono", monospace; }
.info-code {
  background: rgba(0,0,0,0.45); border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px; padding: 12px 14px;
  font-family: "IBM Plex Mono", monospace; font-size: 12px; color: #a8ff78;
  white-space: pre-wrap; word-break: break-all; margin: 0; line-height: 1.55;
  overflow-x: auto;
}

.info-missing-headers { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.info-header-row      { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.info-header-name     { font-family: "IBM Plex Mono", monospace; font-size: 13px; font-weight: 700; color: var(--text); }
.info-header-scenario { font-size: 12px; color: var(--muted); line-height: 1.4; flex: 1 1 200px; }

/* Tooltip (legacy, kept for compatibility) */
.info-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 14px; height: 14px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.1); color: var(--muted);
  font-size: 10px; font-weight: bold; margin-left: 6px; cursor: help;
  position: relative; vertical-align: middle;
}
.info-icon:hover { background: var(--text); color: var(--bg); }

.info-icon::after {
  content: attr(data-tooltip);
  position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%) translateY(-8px);
  width: max-content; max-width: 220px;
  padding: 8px 12px; border-radius: 6px;
  background: #151b2d; border: 1px solid rgba(255,255,255,0.15);
  color: var(--text); font-size: 12px; font-weight: 500; line-height: 1.4;
  opacity: 0; pointer-events: none; transition: opacity 0.2s; box-shadow: 0 4px 12px rgba(0,0,0,0.5);
  z-index: 100; text-align: center;
}
.info-icon:hover::after { opacity: 1; }

.report__score { display: flex; align-items: center; gap: 14px; margin-bottom: 8px; }
.score__ring { width: 54px; height: 54px; border-radius: 999px; display: grid; place-items: center; background: radial-gradient(circle at 50% 50%, rgba(0,255,163,0.18), rgba(0,255,163,0.02)); border: 1px solid rgba(0,255,163,0.35); box-shadow: var(--glow); font-weight: 800; color: var(--text); }
.score__label { color: var(--muted); font-weight: 700; }

/***** Sections *****/
.section { padding: 48px 28px; }
.section__title { font-size: clamp(22px, 3vw, 32px); margin: 0 0 8px; }
.section__lead { color: var(--muted); margin: 0 0 22px; }

.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.card { background: var(--panel); border: 1px solid rgba(255,255,255,0.08); border-radius: 14px; padding: 16px; }
.card h3 { margin: 0 0 8px; font-size: 18px; }
.card p { margin: 0; color: var(--muted); }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.step { background: linear-gradient(180deg, rgba(0,229,255,0.06), rgba(0,229,255,0.02)); border: 1px solid rgba(0,229,255,0.25); border-radius: 14px; padding: 16px; position: relative; }
.step__num { position: absolute; top: 10px; right: 10px; font-weight: 800; color: rgba(255,255,255,0.2); }

/***** CTA *****/
.cta { padding-top: 16px; }
.cta__inner { border: 1px solid rgba(255,255,255,0.08); background: linear-gradient(180deg, rgba(0,255,163,0.06), rgba(0,255,163,0.02)); padding: 24px; border-radius: 16px; text-align: center; }

/***** Footer *****/
.site-footer { padding: 28px; border-top: 1px solid rgba(255,255,255,0.06); background: linear-gradient(180deg, rgba(10,16,34,0.75), rgba(10,16,34,0.5)); }
.footer__grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 16px; align-items: start; }
.footer__nav { display: grid; gap: 8px; }
.footer__nav a { color: var(--muted); text-decoration: none; }
.footer__nav a:hover { color: var(--text); }
.footer__legal { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.small { font-size: 12px; color: var(--muted); }

.brand--footer { display: inline-flex; align-items: center; gap: 10px; }

/***** Reveal on scroll *****/
.reveal { opacity: 0; transform: translateY(12px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.is-visible { opacity: 1; transform: translateY(0); }

/***** A11y helpers *****/
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 1px, 1px); border: 0; }

/***** Animations *****/
@keyframes float {
  0%, 100% { transform: translateY(0) translateX(0); }
  50% { transform: translateY(-10px) translateX(6px); }
}

/* Flag Detection Alert */
@keyframes flash-flag {
  0% {
    border-color: #ff003c;
    box-shadow: 0 0 10px #ff003c inset, 0 0 20px #ff003c;
    color: #fff;
    text-shadow: 0 0 5px #ff003c;
  }
  50% {
    border-color: #fff;
    box-shadow: 0 0 20px #ff003c inset, 0 0 40px #ff003c;
    color: #ff003c;
    text-shadow: none;
  }
  100% {
    border-color: #ff003c;
    box-shadow: 0 0 10px #ff003c inset, 0 0 20px #ff003c;
    color: #fff;
    text-shadow: 0 0 5px #ff003c;
  }
}

.flag-found {
  display: block;
  margin: 24px 0;
  padding: 20px;
  font-size: 16px;
  font-weight: 900;
  text-align: center;
  color: #fff;
  border: 3px solid #ff003c;
  background: rgba(255, 0, 60, 0.15);
  text-shadow: 0 0 10px #ff003c;
  box-shadow: 0 0 30px rgba(255, 0, 60, 0.4);
  animation: flash-flag 1s infinite alternate;
  white-space: pre-wrap;
  word-break: break-all;
  line-height: 1.4;
  font-family: "IBM Plex Mono", monospace;
}

/***** Responsive *****/
@media (max-width: 1000px) {
  .hero { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .features { grid-template-columns: 1fr 1fr; }
  .steps { grid-template-columns: 1fr; }
  .footer__grid { grid-template-columns: 1fr; }
  .footer__legal { justify-content: flex-start; }
  .report-top { flex-direction: column; align-items: flex-start; gap: 20px; }
  .report-meta { margin-left: 0; text-align: left; }
  .meta-stats { justify-content: flex-start; }
}
@media (max-width: 520px) {
  .scan-form { grid-template-columns: 1fr; }
  .btn--primary { width: 100%; }
}

/* ─── Auth Overlay + Sliding Panel ──────────────────────────────────────────── */
.auth-overlay {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  background:
    radial-gradient(900px 500px at 75% -10%, rgba(0,229,255,0.07), transparent),
    radial-gradient(700px 500px at -5% 110%, rgba(0,255,163,0.07), transparent),
    var(--bg);
}
.auth-overlay[hidden] { display: none; }

/* Container principal */
.auth-container {
  position: relative;
  display: flex;
  width: min(940px, 100%);
  height: 580px;
  background: var(--bg-soft);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 40px 100px rgba(0,0,0,0.75), inset 0 1px 0 rgba(255,255,255,0.05);
}

/* Chaque côté (login / register) */
.auth-side {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 52px 44px;
}
.auth-form-wrap { width: 100%; max-width: 310px; }
.auth-form-title { font-size: 28px; font-weight: 800; margin: 0 0 6px; letter-spacing: -0.3px; }
.auth-form-sub { color: var(--muted); font-size: 14px; margin: 0 0 32px; }

/* Formulaire */
.auth-form { display: flex; flex-direction: column; gap: 14px; }

.auth-field { display: flex; flex-direction: column; gap: 6px; }
.auth-field label {
  font-size: 11px; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.7px;
}
.auth-field input {
  height: 46px; padding: 0 16px; border-radius: 10px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--text); font-size: 15px; outline: none;
  font-family: inherit; width: 100%;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.auth-field input:focus {
  border-color: rgba(0,255,163,0.4);
  background: rgba(255,255,255,0.07);
  box-shadow: 0 0 0 3px rgba(0,255,163,0.08);
}
.auth-field input::placeholder { color: #3a5265; }

.auth-error {
  background: rgba(255,92,138,0.09);
  border: 1px solid rgba(255,92,138,0.22);
  border-radius: 8px; padding: 10px 14px;
  color: var(--danger); font-size: 13px; font-weight: 600;
}
.auth-error[hidden] { display: none; }

.auth-submit {
  height: 48px; border-radius: 10px; border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.07);
  color: var(--text); font-size: 15px; font-weight: 700;
  cursor: pointer; font-family: inherit; width: 100%; margin-top: 4px;
  transition: background 0.15s, border-color 0.15s;
}
.auth-submit:hover { background: rgba(255,255,255,0.12); border-color: rgba(255,255,255,0.18); }
.auth-submit:active { transform: translateY(1px); }
.auth-submit:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.auth-switch-hint { margin: 16px 0 0; font-size: 13px; color: var(--muted); }
.auth-switch-link {
  background: none; border: none; color: var(--primary); font-weight: 700;
  cursor: pointer; font-family: inherit; font-size: 13px; padding: 0;
  text-decoration: underline; text-underline-offset: 3px;
}

/* ─── Panneau glissant ───────────────────────────────────────────────────────── */
.auth-panel {
  position: absolute;
  top: 0; left: 50%;
  width: 50%; height: 100%;
  z-index: 10;
  background: linear-gradient(145deg, #00ffa3 0%, #00d488 45%, #00b8c8 100%);
  transition: transform 0.7s cubic-bezier(0.65, 0, 0.35, 1);
  overflow: hidden;
}

/* Le panneau glisse à gauche quand register est actif */
.auth-container.is-register .auth-panel {
  transform: translateX(-100%);
}

/* Orbes décoratifs */
.auth-panel__orb {
  position: absolute; border-radius: 50%;
  background: rgba(4,26,14,0.1);
  pointer-events: none;
}
.auth-panel__orb--1 { width: 340px; height: 340px; top: -100px; right: -100px; }
.auth-panel__orb--2 { width: 220px; height: 220px; bottom: -60px; left: -60px; }

/* Faces du panneau */
.auth-panel__face {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center; padding: 48px 40px;
  transition: opacity 0.25s 0.15s, transform 0.3s 0.1s;
  pointer-events: none; /* désactivé par défaut pour toutes les faces */
}
/* Face A : visible + cliquable quand login (panneau à droite) */
.auth-panel__face--a { opacity: 1; transform: translateX(0); pointer-events: auto; }
/* Face B : cachée et non-cliquable quand login */
.auth-panel__face--b { opacity: 0; transform: translateX(24px); }

/* Swap des faces lors du passage en register */
.auth-container.is-register .auth-panel__face--a { opacity: 0; transform: translateX(-24px); pointer-events: none; }
.auth-container.is-register .auth-panel__face--b { opacity: 1; transform: translateX(0); pointer-events: auto; }

.auth-panel__face svg {
  margin-bottom: 20px;
  filter: drop-shadow(0 4px 16px rgba(4,26,14,0.25));
}
.auth-panel__face h3 {
  font-size: 30px; font-weight: 800; color: #041a0e;
  margin: 0 0 14px; letter-spacing: -0.4px;
}
.auth-panel__face p {
  color: rgba(4,26,14,0.7); font-size: 16px;
  line-height: 1.55; margin: 0 0 32px;
}
.auth-panel__btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 13px 32px; border-radius: 10px;
  background: rgba(4,26,14,0.12);
  border: 2px solid rgba(4,26,14,0.2);
  color: #041a0e; font-size: 15px; font-weight: 700;
  cursor: pointer; font-family: inherit;
  transition: background 0.15s, transform 0.15s, box-shadow 0.15s;
  position: relative; z-index: 1;
}
.auth-panel__btn:hover {
  background: rgba(4,26,14,0.22);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(4,26,14,0.15);
}
.auth-panel__btn:active { transform: translateY(0); }

/* ─── Nav user ───────────────────────────────────────────────────────────────── */
.nav-user { display: flex; align-items: center; gap: 10px; }
.nav-user-email { color: var(--muted); font-size: 13px; font-weight: 600; max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.btn--sm { padding: 6px 12px; font-size: 13px; border-radius: 8px; }

/* Mobile : empilé sans panneau */
@media (max-width: 640px) {
  .auth-container { height: auto; flex-direction: column; }
  .auth-panel { display: none; }
  .auth-side { padding: 36px 28px; }
  .auth-container:not(.is-register) .auth-side--register { display: none; }
  .auth-container.is-register .auth-side--login { display: none; }
}