/* ================================================
   AUDYT — DESIGN SYSTEM
   Mobile-first. Editorial premium.
   Instrument Serif (display) + IBM Plex Sans (body) + IBM Plex Mono (data)
   ================================================ */

/* ---------- RESET ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { font-family: var(--font-body); color: var(--ink); background: var(--bg); line-height: 1.55; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; min-height: 100dvh; overflow-x: hidden; }
img, svg { display: block; max-width: 100%; height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: none; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }

/* ---------- TOKENS ---------- */
:root {
  /* Couleurs */
  --bg: #fdfbf3;
  --bg-deep: #f6f1e1;
  --bg-card: #ffffff;
  --ink: #1a1815;
  --ink-soft: #4a4642;
  --ink-mute: #8a847d;
  --line: rgba(26, 24, 21, 0.12);
  --line-strong: rgba(26, 24, 21, 0.24);

  /* Accent rouge tampon administratif */
  --accent: #a4243b;
  --accent-deep: #7d1a2c;
  --accent-soft: #f5e2e6;

  /* Sémantique */
  --success: #1f5128;
  --success-soft: #e3eddc;
  --warning: #a16207;
  --warning-soft: #faecc7;
  --critical: #7f1d1d;
  --critical-soft: #f5dada;

  /* Typographie */
  --font-display: 'Instrument Serif', 'Times New Roman', Georgia, serif;
  --font-body: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  /* Échelle (mobile-first) */
  --t-xs: 0.75rem;
  --t-sm: 0.875rem;
  --t-base: 1rem;
  --t-md: 1.125rem;
  --t-lg: 1.25rem;
  --t-xl: 1.5rem;
  --t-2xl: 2rem;
  --t-3xl: 2.5rem;
  --t-4xl: 3rem;

  /* Espacements (multiples de 4) */
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 20px; --s-6: 24px;
  --s-8: 32px; --s-10: 40px; --s-12: 48px; --s-16: 64px; --s-20: 80px; --s-24: 96px;

  /* Rayons */
  --r-sm: 6px; --r-md: 10px; --r-lg: 14px; --r-xl: 20px;

  /* Easing */
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

@media (min-width: 768px) {
  :root {
    --t-2xl: 2.25rem;
    --t-3xl: 3rem;
    --t-4xl: 4rem;
  }
}

@media (min-width: 1024px) {
  :root {
    --t-3xl: 3.5rem;
    --t-4xl: 5rem;
  }
}

/* ---------- SAFE AREA ---------- */
.safe-pb { padding-bottom: max(var(--s-4), env(safe-area-inset-bottom)); }
.safe-pt { padding-top: max(var(--s-4), env(safe-area-inset-top)); }

/* ---------- TYPO ---------- */
.serif { font-family: var(--font-display); font-weight: 400; letter-spacing: -0.01em; }
.mono { font-family: var(--font-mono); }
.eyebrow { font-family: var(--font-mono); font-size: var(--t-xs); text-transform: uppercase; letter-spacing: 0.18em; color: var(--ink-mute); font-weight: 500; }
.eyebrow--accent { color: var(--accent); }

h1, .h1 { font-family: var(--font-display); font-size: var(--t-3xl); line-height: 1.05; letter-spacing: -0.02em; font-weight: 400; }
h2, .h2 { font-family: var(--font-display); font-size: var(--t-2xl); line-height: 1.1; letter-spacing: -0.015em; font-weight: 400; }
h3, .h3 { font-family: var(--font-body); font-size: var(--t-lg); line-height: 1.3; font-weight: 600; letter-spacing: -0.005em; }
h4, .h4 { font-family: var(--font-body); font-size: var(--t-base); line-height: 1.4; font-weight: 600; }

.lead { font-size: var(--t-md); color: var(--ink-soft); line-height: 1.55; }
.muted { color: var(--ink-mute); }
.tnum { font-variant-numeric: tabular-nums; letter-spacing: 0.01em; }
.italic { font-style: italic; }

/* ---------- LAYOUT ---------- */
.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 var(--s-5); }
@media (min-width: 768px) { .container { padding: 0 var(--s-8); } }
.section { padding: var(--s-16) 0; }
@media (min-width: 768px) { .section { padding: var(--s-24) 0; } }
.section--tight { padding: var(--s-12) 0; }

.divider { height: 1px; background: var(--line); border: 0; margin: 0; }
.divider--strong { background: var(--line-strong); }

/* ---------- HEADER ---------- */
.header { position: sticky; top: 0; z-index: 50; background: rgba(253, 251, 243, 0.85); -webkit-backdrop-filter: saturate(180%) blur(12px); backdrop-filter: saturate(180%) blur(12px); border-bottom: 1px solid var(--line); }
.header__inner { display: flex; align-items: center; justify-content: space-between; height: 56px; padding: 0 var(--s-5); max-width: 1200px; margin: 0 auto; }
@media (min-width: 768px) { .header__inner { height: 64px; padding: 0 var(--s-8); } }

.logo { display: inline-flex; align-items: center; gap: var(--s-2); font-family: var(--font-display); font-size: var(--t-xl); letter-spacing: -0.01em; }
.logo__mark { width: 22px; height: 22px; border-radius: 4px; background: var(--accent); position: relative; flex-shrink: 0; }
.logo__mark::after { content: ''; position: absolute; inset: 5px; border: 1.5px solid var(--bg); border-radius: 2px; }

.nav { display: none; align-items: center; gap: var(--s-6); }
@media (min-width: 1024px) { .nav { display: flex; } }
.nav a { font-size: var(--t-sm); color: var(--ink-soft); transition: color 0.2s var(--ease); }
.nav a:hover, .nav a:focus-visible { color: var(--ink); }

.header__cta { display: inline-flex; align-items: center; gap: var(--s-2); padding: var(--s-2) var(--s-4); height: 40px; font-size: var(--t-sm); font-weight: 500; border: 1px solid var(--line-strong); border-radius: var(--r-md); transition: all 0.2s var(--ease); }
.header__cta:hover, .header__cta:focus-visible { background: var(--ink); color: var(--bg); border-color: var(--ink); }

.menu-toggle { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: var(--r-md); margin-right: -8px; }
@media (min-width: 1024px) { .menu-toggle { display: none; } }

/* ---------- HERO ---------- */
.hero { padding: var(--s-12) 0 var(--s-16); position: relative; overflow: hidden; }
@media (min-width: 768px) { .hero { padding: var(--s-20) 0 var(--s-24); } }

.hero__inner { max-width: 760px; margin: 0 auto; text-align: left; }
@media (min-width: 768px) { .hero__inner { text-align: center; } }

.hero h1 { font-size: clamp(2.25rem, 8vw, 4.5rem); line-height: 0.98; margin-bottom: var(--s-6); }
.hero h1 em { font-style: italic; color: var(--accent); }

.hero__sub { font-size: var(--t-md); color: var(--ink-soft); max-width: 600px; margin: 0 0 var(--s-8); }
@media (min-width: 768px) { .hero__sub { margin: 0 auto var(--s-10); font-size: var(--t-lg); } }

.hero__form { display: flex; flex-direction: column; gap: var(--s-3); max-width: 480px; }
@media (min-width: 768px) { .hero__form { margin: 0 auto; } }

.hero__trust { display: flex; flex-wrap: wrap; gap: var(--s-3) var(--s-6); margin-top: var(--s-6); font-size: var(--t-sm); color: var(--ink-mute); }
@media (min-width: 768px) { .hero__trust { justify-content: center; } }
.hero__trust span { display: inline-flex; align-items: center; gap: var(--s-1); }
.hero__trust svg { width: 16px; height: 16px; color: var(--success); flex-shrink: 0; }

.hero__demo-link { background: none; border: none; color: var(--ink-mute); font-size: var(--t-sm); text-decoration: underline; text-underline-offset: 3px; padding: var(--s-2) 0; align-self: flex-start; }
@media (min-width: 768px) { .hero__demo-link { align-self: center; } }
.hero__demo-link:hover { color: var(--ink); }

/* ---------- FORM ---------- */
.label { display: block; font-size: var(--t-sm); font-weight: 500; margin-bottom: var(--s-2); color: var(--ink); }
.label--mute { color: var(--ink-soft); font-weight: 400; }

.input { width: 100%; min-height: 56px; padding: 0 var(--s-4); background: var(--bg-card); border: 1px solid var(--line-strong); border-radius: var(--r-md); font-size: var(--t-md); transition: all 0.2s var(--ease); -webkit-appearance: none; appearance: none; }
.input:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(26,24,21,0.08); }
.input--mono { font-family: var(--font-mono); letter-spacing: 0.05em; }
.input[aria-invalid="true"] { border-color: var(--critical); }
.input[aria-invalid="true"]:focus { box-shadow: 0 0 0 3px var(--critical-soft); }

.hint { font-size: var(--t-sm); color: var(--ink-mute); margin-top: var(--s-2); }
.error { font-size: var(--t-sm); color: var(--critical); margin-top: var(--s-2); }

/* ---------- BUTTONS ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2); min-height: 56px; padding: 0 var(--s-6); border-radius: var(--r-md); font-size: var(--t-base); font-weight: 500; transition: all 0.2s var(--ease); border: 1px solid transparent; line-height: 1; -webkit-tap-highlight-color: transparent; }
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn:disabled:active { transform: none; }

.btn--primary { background: var(--ink); color: var(--bg); }
.btn--primary:hover:not(:disabled) { background: var(--accent); }

.btn--accent { background: var(--accent); color: #fff; }
.btn--accent:hover:not(:disabled) { background: var(--accent-deep); }

.btn--ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn--ghost:hover:not(:disabled) { background: var(--ink); color: var(--bg); border-color: var(--ink); }

.btn--small { min-height: 44px; padding: 0 var(--s-4); font-size: var(--t-sm); }
.btn--full { width: 100%; }

.btn--icon { width: 44px; height: 44px; min-height: 44px; padding: 0; }

/* ---------- STICKY BOTTOM CTA ---------- */
.sticky-cta { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: var(--bg); border-top: 1px solid var(--line); padding: var(--s-3) var(--s-5) max(var(--s-3), env(safe-area-inset-bottom)); display: flex; gap: var(--s-3); }
@media (min-width: 768px) { .sticky-cta { padding: var(--s-4) var(--s-8) max(var(--s-4), env(safe-area-inset-bottom)); } }

/* ---------- BADGES ---------- */
.badge { display: inline-flex; align-items: center; gap: var(--s-1); padding: var(--s-1) var(--s-3); border-radius: 999px; font-family: var(--font-mono); font-size: var(--t-xs); font-weight: 500; letter-spacing: 0.04em; text-transform: uppercase; }
.badge--success { background: var(--success-soft); color: var(--success); }
.badge--warning { background: var(--warning-soft); color: var(--warning); }
.badge--critical { background: var(--critical-soft); color: var(--critical); }
.badge--neutral { background: rgba(26,24,21,0.06); color: var(--ink-soft); }
.badge--accent { background: var(--accent-soft); color: var(--accent); }

/* ---------- CARDS ---------- */
.card { background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s-6); }
.card--soft { background: var(--bg-deep); }
.card--accent { background: var(--accent-soft); border-color: var(--accent-soft); }
.card--ghost { background: transparent; border: 1px dashed var(--line-strong); }

/* ---------- GRID ---------- */
.grid { display: grid; gap: var(--s-4); }
.grid-2 { grid-template-columns: 1fr; }
@media (min-width: 768px) { .grid-2 { grid-template-columns: 1fr 1fr; gap: var(--s-6); } }
.grid-3 { grid-template-columns: 1fr; }
@media (min-width: 640px) { .grid-3 { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1024px) { .grid-3 { grid-template-columns: repeat(3, 1fr); gap: var(--s-6); } }

/* ---------- ROMAN NUMBERS (éditorial) ---------- */
.roman { font-family: var(--font-display); font-size: var(--t-2xl); color: var(--accent); display: inline-block; margin-right: var(--s-3); font-style: italic; }

/* ---------- TESTIMONIALS ---------- */
.testimonial { padding: var(--s-6); border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--bg-card); }
.testimonial__quote { font-family: var(--font-display); font-size: var(--t-lg); line-height: 1.4; margin-bottom: var(--s-4); }
.testimonial__author { font-size: var(--t-sm); color: var(--ink-mute); }
.testimonial__author strong { color: var(--ink); font-weight: 500; }

/* ---------- STEPS ---------- */
.step { display: flex; gap: var(--s-4); padding: var(--s-6) 0; border-top: 1px solid var(--line); }
.step:first-child { border-top: 0; }
.step__num { font-family: var(--font-display); font-size: var(--t-xl); color: var(--accent); flex-shrink: 0; min-width: 40px; font-style: italic; }
.step__body h3 { margin-bottom: var(--s-2); }
.step__body p { color: var(--ink-soft); font-size: var(--t-sm); }

/* ---------- FEATURE GRID ---------- */
.feature { padding: var(--s-5) 0; border-top: 1px solid var(--line); display: flex; gap: var(--s-4); }
.feature:first-child { border-top: 0; padding-top: 0; }
.feature__icon { width: 36px; height: 36px; flex-shrink: 0; color: var(--accent); }
.feature h3 { font-size: var(--t-base); margin-bottom: var(--s-1); }
.feature p { font-size: var(--t-sm); color: var(--ink-soft); line-height: 1.5; }

/* ---------- COMPARISON BLOCK ---------- */
.compare { display: grid; grid-template-columns: 1fr; gap: var(--s-3); }
@media (min-width: 768px) { .compare { grid-template-columns: 1fr 1fr; gap: var(--s-6); } }
.compare__col { padding: var(--s-6); border-radius: var(--r-lg); }
.compare__col--no { background: var(--bg-deep); border: 1px solid var(--line); }
.compare__col--yes { background: var(--ink); color: var(--bg); }
.compare__col h3 { margin-bottom: var(--s-4); }
.compare__list li { padding: var(--s-2) 0; font-size: var(--t-sm); display: flex; gap: var(--s-2); align-items: flex-start; }
.compare__list li::before { content: '—'; flex-shrink: 0; }
.compare__col--no li::before { color: var(--critical); }
.compare__col--yes li::before { color: var(--bg-deep); opacity: 0.6; }

/* ---------- PRICING ---------- */
.price-card { padding: var(--s-8) var(--s-6); border: 1px solid var(--line); border-radius: var(--r-xl); background: var(--bg-card); display: flex; flex-direction: column; gap: var(--s-4); }
.price-card--featured { background: var(--ink); color: var(--bg); border-color: var(--ink); position: relative; }
.price-card--featured .label--mute { color: rgba(253,251,243,0.6); }
.price-card__amount { font-family: var(--font-display); font-size: var(--t-4xl); line-height: 1; }
.price-card__amount sup { font-size: var(--t-md); vertical-align: top; opacity: 0.6; margin-left: 4px; }
.price-card__features { display: flex; flex-direction: column; gap: var(--s-2); margin: var(--s-4) 0; }
.price-card__features li { font-size: var(--t-sm); display: flex; gap: var(--s-2); align-items: flex-start; }
.price-card__features li::before { content: '✓'; color: var(--success); flex-shrink: 0; font-weight: 600; }
.price-card--featured .price-card__features li::before { color: var(--bg-deep); }

.tag-featured { position: absolute; top: -10px; left: 50%; transform: translateX(-50%); background: var(--accent); color: #fff; padding: 4px 12px; border-radius: 999px; font-family: var(--font-mono); font-size: var(--t-xs); text-transform: uppercase; letter-spacing: 0.1em; }

/* ---------- FAQ ---------- */
.faq-item { border-top: 1px solid var(--line); }
.faq-item:last-child { border-bottom: 1px solid var(--line); }
.faq-q { width: 100%; text-align: left; padding: var(--s-5) 0; display: flex; justify-content: space-between; align-items: center; gap: var(--s-4); font-size: var(--t-md); font-family: var(--font-display); transition: color 0.2s var(--ease); min-height: 44px; }
.faq-q:hover { color: var(--accent); }
.faq-q[aria-expanded="true"] { color: var(--accent); }
.faq-q__chevron { width: 20px; height: 20px; flex-shrink: 0; transition: transform 0.3s var(--ease); }
.faq-q[aria-expanded="true"] .faq-q__chevron { transform: rotate(180deg); }
.faq-a { max-height: 0; overflow: hidden; transition: max-height 0.4s var(--ease), padding 0.3s var(--ease); }
.faq-q[aria-expanded="true"] + .faq-a { max-height: 500px; padding-bottom: var(--s-5); }
.faq-a p { color: var(--ink-soft); font-size: var(--t-sm); }

/* ---------- LEGAL DISCLAIMER ---------- */
.disclaimer { padding: var(--s-6); background: var(--bg-deep); border: 1px solid var(--line); border-radius: var(--r-md); font-size: var(--t-sm); color: var(--ink-soft); line-height: 1.6; }
.disclaimer strong { color: var(--ink); }

/* ---------- FOOTER ---------- */
.footer { background: var(--ink); color: rgba(253,251,243,0.7); padding: var(--s-16) 0 var(--s-8); margin-top: var(--s-16); }
.footer__grid { display: grid; grid-template-columns: 1fr; gap: var(--s-8); margin-bottom: var(--s-12); }
@media (min-width: 640px) { .footer__grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1024px) { .footer__grid { grid-template-columns: 2fr 1fr 1fr 1fr; } }
.footer h4 { color: var(--bg); font-size: var(--t-sm); font-weight: 500; margin-bottom: var(--s-3); font-family: var(--font-mono); text-transform: uppercase; letter-spacing: 0.1em; }
.footer ul { display: flex; flex-direction: column; gap: var(--s-2); }
.footer ul a { font-size: var(--t-sm); transition: color 0.2s var(--ease); }
.footer ul a:hover { color: var(--bg); }
.footer__bottom { border-top: 1px solid rgba(253,251,243,0.1); padding-top: var(--s-6); font-size: var(--t-xs); display: flex; flex-wrap: wrap; gap: var(--s-3); justify-content: space-between; }

/* ---------- MODALS / BOTTOM SHEETS ---------- */
.modal { position: fixed; inset: 0; z-index: 100; display: none; align-items: flex-end; justify-content: center; }
.modal.is-open { display: flex; animation: fadeIn 0.25s var(--ease); }
.modal__backdrop { position: absolute; inset: 0; background: rgba(26,24,21,0.5); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.modal__panel { position: relative; width: 100%; max-width: 600px; background: var(--bg); border-radius: var(--r-xl) var(--r-xl) 0 0; padding: var(--s-6) var(--s-5) max(var(--s-6), env(safe-area-inset-bottom)); max-height: 92vh; overflow-y: auto; animation: slideUp 0.3s var(--ease); }
@media (min-width: 768px) {
  .modal { align-items: center; }
  .modal__panel { border-radius: var(--r-xl); padding: var(--s-8); max-height: 88vh; }
}
.modal__handle { width: 36px; height: 4px; background: var(--line-strong); border-radius: 2px; margin: -4px auto var(--s-4); }
@media (min-width: 768px) { .modal__handle { display: none; } }
.modal__close { position: absolute; top: var(--s-4); right: var(--s-4); width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; border-radius: var(--r-md); }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }

/* ---------- DEMO COMPANY CARDS ---------- */
.demo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-3); margin-top: var(--s-5); }
@media (min-width: 640px) { .demo-grid { grid-template-columns: repeat(3, 1fr); gap: var(--s-4); } }
.demo-card { padding: var(--s-4); border: 1px solid var(--line); border-radius: var(--r-md); background: var(--bg-card); text-align: left; cursor: pointer; transition: all 0.2s var(--ease); display: flex; flex-direction: column; gap: var(--s-2); min-height: 130px; }
.demo-card:hover { border-color: var(--ink); transform: translateY(-2px); }
.demo-card:active { transform: translateY(0); }
.demo-card__icon { width: 28px; height: 28px; color: var(--accent); }
.demo-card__sector { font-family: var(--font-display); font-size: var(--t-md); line-height: 1.2; }
.demo-card__name { font-family: var(--font-mono); font-size: 10px; color: var(--ink-mute); text-transform: uppercase; letter-spacing: 0.05em; }
.demo-card__desc { font-size: var(--t-xs); color: var(--ink-soft); line-height: 1.4; margin-top: auto; }

/* ---------- LOADER / SPINNER ---------- */
.spinner { width: 20px; height: 20px; border: 2px solid currentColor; border-top-color: transparent; border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.pulse { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--success); position: relative; }
.pulse::after { content: ''; position: absolute; inset: -6px; border-radius: 50%; background: var(--success); opacity: 0.3; animation: pulse 1.4s ease-out infinite; }
@keyframes pulse { 0% { transform: scale(0.6); opacity: 0.6; } 100% { transform: scale(2); opacity: 0; } }

/* ---------- PROGRESS BAR ---------- */
.progress { height: 3px; background: var(--line); border-radius: 999px; overflow: hidden; }
.progress__fill { height: 100%; background: var(--accent); transition: width 0.5s var(--ease); }

/* ---------- QUESTIONNAIRE ---------- */
.q-screen { min-height: calc(100dvh - 56px - 88px); padding: var(--s-8) 0 var(--s-12); display: flex; flex-direction: column; }
.q-progress { padding: var(--s-3) var(--s-5); display: flex; align-items: center; gap: var(--s-4); border-bottom: 1px solid var(--line); }
.q-progress .progress { flex: 1; }
.q-progress__count { font-family: var(--font-mono); font-size: var(--t-xs); color: var(--ink-mute); white-space: nowrap; }

.q-card { max-width: 600px; margin: 0 auto; width: 100%; padding: 0 var(--s-5); animation: fadeUp 0.4s var(--ease); }
.q-eyebrow { font-family: var(--font-mono); font-size: var(--t-xs); color: var(--accent); text-transform: uppercase; letter-spacing: 0.15em; margin-bottom: var(--s-3); }
.q-title { font-family: var(--font-display); font-size: var(--t-2xl); line-height: 1.15; margin-bottom: var(--s-2); }
.q-help { color: var(--ink-soft); font-size: var(--t-sm); margin-bottom: var(--s-6); }

.q-options { display: flex; flex-direction: column; gap: var(--s-3); }
.q-option { display: flex; align-items: center; gap: var(--s-3); padding: var(--s-4) var(--s-5); min-height: 56px; background: var(--bg-card); border: 1px solid var(--line-strong); border-radius: var(--r-md); cursor: pointer; transition: all 0.15s var(--ease); text-align: left; font-size: var(--t-base); }
.q-option:hover { border-color: var(--ink); }
.q-option--active { border-color: var(--ink); background: var(--ink); color: var(--bg); }
.q-option__check { width: 20px; height: 20px; border-radius: 4px; border: 1.5px solid var(--line-strong); flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; }
.q-option--active .q-option__check { border-color: var(--bg); background: var(--bg); color: var(--ink); }
.q-option__check svg { display: none; width: 14px; height: 14px; }
.q-option--active .q-option__check svg { display: block; }
.q-option--radio .q-option__check { border-radius: 50%; }

@keyframes fadeUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }

/* ---------- GENERATION SCREEN ---------- */
.gen-screen { min-height: 100dvh; display: flex; flex-direction: column; justify-content: center; align-items: center; padding: var(--s-8) var(--s-5); text-align: center; }
.gen-mark { width: 64px; height: 64px; border-radius: var(--r-md); background: var(--accent); position: relative; margin-bottom: var(--s-8); animation: pulseMark 2s ease-in-out infinite; }
.gen-mark::after { content: ''; position: absolute; inset: 14px; border: 2px solid var(--bg); border-radius: 4px; }
@keyframes pulseMark { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.05); } }

.gen-title { font-family: var(--font-display); font-size: var(--t-2xl); margin-bottom: var(--s-8); max-width: 420px; }
.gen-steps { display: flex; flex-direction: column; gap: var(--s-3); width: 100%; max-width: 380px; text-align: left; }
.gen-step { display: flex; align-items: center; gap: var(--s-3); font-size: var(--t-sm); color: var(--ink-mute); transition: color 0.4s var(--ease); }
.gen-step--done { color: var(--ink); }
.gen-step--active { color: var(--ink); font-weight: 500; }
.gen-step__icon { width: 18px; height: 18px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; border: 1.5px solid currentColor; transition: all 0.3s var(--ease); }
.gen-step--done .gen-step__icon { background: var(--success); border-color: var(--success); color: #fff; }
.gen-step--active .gen-step__icon { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ---------- RESUME SCREEN ---------- */
.resume-header { padding: var(--s-8) 0 var(--s-6); border-bottom: 1px solid var(--line); }
.score-grid { display: grid; grid-template-columns: 1fr; gap: var(--s-3); margin: var(--s-6) 0; }
@media (min-width: 640px) { .score-grid { grid-template-columns: repeat(3, 1fr); } }

.score-card { padding: var(--s-5); border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--bg-card); }
.score-card__label { font-family: var(--font-mono); font-size: var(--t-xs); color: var(--ink-mute); text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: var(--s-2); }
.score-card__value { font-family: var(--font-display); font-size: var(--t-3xl); line-height: 1; }
.score-card__sub { font-size: var(--t-sm); color: var(--ink-soft); margin-top: var(--s-2); }

.gauge { width: 100%; height: 8px; background: var(--line); border-radius: 999px; overflow: hidden; margin-top: var(--s-3); }
.gauge__fill { height: 100%; transition: width 0.8s var(--ease); border-radius: 999px; }
.gauge__fill--success { background: var(--success); }
.gauge__fill--warning { background: var(--warning); }
.gauge__fill--critical { background: var(--critical); }

.alert-card { padding: var(--s-5); border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--bg-card); margin-bottom: var(--s-4); }
.alert-card__head { display: flex; flex-wrap: wrap; gap: var(--s-2); align-items: center; margin-bottom: var(--s-3); }
.alert-card h3 { font-family: var(--font-display); font-size: var(--t-lg); margin-bottom: var(--s-3); line-height: 1.3; }
.alert-card p { color: var(--ink-soft); font-size: var(--t-sm); margin-bottom: var(--s-3); line-height: 1.55; }
.alert-card__source { font-family: var(--font-mono); font-size: var(--t-xs); color: var(--ink-mute); display: inline-flex; align-items: center; gap: var(--s-1); }
.alert-card__source a { text-decoration: underline; text-underline-offset: 2px; }

.locked { position: relative; padding: var(--s-6); border: 1px dashed var(--line-strong); border-radius: var(--r-lg); background: var(--bg-deep); margin-top: var(--s-6); }
.locked__title { font-family: var(--font-display); font-size: var(--t-xl); margin-bottom: var(--s-3); }
.locked__list { display: flex; flex-direction: column; gap: var(--s-2); }
.locked__item { display: flex; align-items: center; gap: var(--s-3); padding: var(--s-2) 0; filter: blur(4px); user-select: none; pointer-events: none; opacity: 0.7; }
.locked__overlay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.locked__lockicon { width: 48px; height: 48px; padding: 12px; background: var(--bg); border-radius: 50%; box-shadow: 0 4px 16px rgba(26,24,21,0.08); color: var(--accent); }

.purchase-grid { display: grid; grid-template-columns: 1fr; gap: var(--s-3); margin-top: var(--s-6); }
@media (min-width: 640px) { .purchase-grid { grid-template-columns: 1fr 1fr; } }

/* ---------- CHECKOUT ---------- */
.checkout { display: grid; grid-template-columns: 1fr; gap: var(--s-6); max-width: 920px; margin: 0 auto; padding: var(--s-8) var(--s-5); }
@media (min-width: 768px) { .checkout { grid-template-columns: 1fr 1.2fr; gap: var(--s-12); padding: var(--s-12) var(--s-8); } }
.checkout__order { background: var(--bg-deep); border-radius: var(--r-lg); padding: var(--s-6); align-self: start; }
.checkout__form { display: flex; flex-direction: column; gap: var(--s-4); }

.cb-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-3); }

/* ---------- REPORT ---------- */
.report-header { padding: var(--s-8) 0; border-bottom: 1px solid var(--line); }
.report-header__brand { font-family: var(--font-mono); font-size: var(--t-xs); text-transform: uppercase; letter-spacing: 0.2em; color: var(--accent); margin-bottom: var(--s-3); }
.report-header h1 { font-size: var(--t-3xl); line-height: 1.05; margin-bottom: var(--s-4); }
.report-header__meta { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-5); font-size: var(--t-sm); color: var(--ink-mute); margin-bottom: var(--s-5); }
.report-header__meta span { display: flex; align-items: center; gap: var(--s-1); }

.report-section { padding: var(--s-12) 0; border-top: 1px solid var(--line); }
.report-section__num { font-family: var(--font-display); font-style: italic; font-size: var(--t-2xl); color: var(--accent); margin-bottom: var(--s-2); }
.report-section h2 { font-size: var(--t-2xl); margin-bottom: var(--s-3); }
.report-section__intro { color: var(--ink-soft); font-size: var(--t-md); margin-bottom: var(--s-6); max-width: 720px; line-height: 1.6; }

.synthesis { font-family: var(--font-display); font-size: var(--t-md); line-height: 1.6; color: var(--ink); font-style: italic; max-width: 720px; }
.synthesis p { margin-bottom: var(--s-4); }
.synthesis p:last-child { margin-bottom: 0; }

.recommendation { padding: var(--s-6); background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--r-lg); margin-bottom: var(--s-4); }
.recommendation__head { display: flex; flex-wrap: wrap; gap: var(--s-2); align-items: center; margin-bottom: var(--s-4); }
.recommendation__title { font-family: var(--font-display); font-size: var(--t-xl); line-height: 1.3; margin-bottom: var(--s-3); }
.recommendation__body p { color: var(--ink-soft); margin-bottom: var(--s-3); font-size: var(--t-sm); line-height: 1.6; }
.recommendation__details { display: grid; grid-template-columns: 1fr; gap: var(--s-2); padding: var(--s-4); background: var(--bg-deep); border-radius: var(--r-md); margin: var(--s-4) 0; font-size: var(--t-sm); }
@media (min-width: 640px) { .recommendation__details { grid-template-columns: 1fr 1fr; } }
.recommendation__details dt { color: var(--ink-mute); font-family: var(--font-mono); font-size: var(--t-xs); text-transform: uppercase; letter-spacing: 0.05em; }
.recommendation__details dd { font-weight: 500; margin-bottom: var(--s-2); }

.timeline-week { padding: var(--s-4) 0; border-top: 1px solid var(--line); display: grid; grid-template-columns: 80px 1fr; gap: var(--s-4); align-items: start; }
.timeline-week:first-of-type { border-top: 0; }
.timeline-week__label { font-family: var(--font-mono); font-size: var(--t-xs); color: var(--accent); text-transform: uppercase; letter-spacing: 0.1em; padding-top: 4px; }
.timeline-week__body p { font-size: var(--t-sm); margin-bottom: var(--s-2); }
.timeline-week__body strong { font-weight: 600; }

.sources-list { display: grid; grid-template-columns: 1fr; gap: var(--s-3); }
@media (min-width: 768px) { .sources-list { grid-template-columns: 1fr 1fr; } }
.source-item { padding: var(--s-3) var(--s-4); border: 1px solid var(--line); border-radius: var(--r-md); font-size: var(--t-sm); display: flex; flex-direction: column; gap: var(--s-1); transition: all 0.2s var(--ease); }
.source-item:hover { border-color: var(--accent); background: var(--accent-soft); }
.source-item__ref { font-family: var(--font-mono); font-size: var(--t-xs); color: var(--accent); }
.source-item__title { color: var(--ink); }

/* ---------- DASHBOARD ---------- */
.dash-header { padding: var(--s-8) 0 var(--s-6); }
.dash-grid { display: grid; grid-template-columns: 1fr; gap: var(--s-4); }
@media (min-width: 768px) { .dash-grid { grid-template-columns: 2fr 1fr; gap: var(--s-6); } }
.diag-item { padding: var(--s-5); border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--bg-card); margin-bottom: var(--s-3); display: flex; flex-direction: column; gap: var(--s-3); }
.diag-item__head { display: flex; justify-content: space-between; align-items: start; gap: var(--s-3); flex-wrap: wrap; }
.diag-item__title { font-family: var(--font-display); font-size: var(--t-lg); }
.diag-item__date { font-family: var(--font-mono); font-size: var(--t-xs); color: var(--ink-mute); }
.diag-item__stats { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-5); font-size: var(--t-sm); }
.diag-item__stats span { color: var(--ink-soft); }
.diag-item__stats strong { color: var(--ink); }

.alert-item { padding: var(--s-4); border-left: 3px solid var(--accent); background: var(--bg-card); margin-bottom: var(--s-3); }
.alert-item__date { font-family: var(--font-mono); font-size: var(--t-xs); color: var(--ink-mute); margin-bottom: var(--s-1); }
.alert-item__title { font-size: var(--t-sm); margin-bottom: var(--s-1); font-weight: 500; }
.alert-item__body { font-size: var(--t-sm); color: var(--ink-soft); }

.banner { padding: var(--s-4); background: var(--success-soft); border-left: 3px solid var(--success); border-radius: var(--r-md); display: flex; gap: var(--s-3); align-items: center; margin-bottom: var(--s-6); }
.banner svg { color: var(--success); width: 24px; height: 24px; flex-shrink: 0; }
.banner__body { font-size: var(--t-sm); }
.banner__body strong { color: var(--success); }

/* ---------- PROFIL DETECTION SCREEN ---------- */
.detect-loader { min-height: 70vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--s-6); padding: var(--s-8); }
.detect-loader__title { font-family: var(--font-display); font-size: var(--t-xl); text-align: center; }

.profile-card { max-width: 580px; margin: var(--s-8) auto 0; padding: var(--s-6); background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--r-lg); }
.profile-card__head { display: flex; gap: var(--s-3); align-items: start; margin-bottom: var(--s-5); padding-bottom: var(--s-4); border-bottom: 1px solid var(--line); }
.profile-card__icon { width: 48px; height: 48px; border-radius: var(--r-md); background: var(--accent-soft); color: var(--accent); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.profile-card__title { font-family: var(--font-display); font-size: var(--t-xl); line-height: 1.2; margin-bottom: var(--s-1); }
.profile-card__sub { font-size: var(--t-sm); color: var(--ink-mute); }
.profile-card dl { display: grid; grid-template-columns: 1fr; gap: var(--s-3); }
@media (min-width: 480px) { .profile-card dl { grid-template-columns: 1fr 1fr; } }
.profile-card dt { font-family: var(--font-mono); font-size: var(--t-xs); color: var(--ink-mute); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 2px; }
.profile-card dd { font-size: var(--t-sm); font-weight: 500; }

/* ---------- LOGIN ---------- */
.login-container { min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: var(--s-8) var(--s-5); }
.login-card { width: 100%; max-width: 420px; }
.login-back { display: inline-flex; align-items: center; gap: var(--s-2); font-size: var(--t-sm); color: var(--ink-mute); margin-top: var(--s-6); transition: color 0.2s var(--ease); }
.login-back:hover { color: var(--ink); }

/* ---------- ACCESSIBILITY ---------- */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ---------- SCROLL FADE-UP ---------- */
.fade-up { opacity: 0; transform: translateY(20px); transition: opacity 0.6s var(--ease), transform 0.6s var(--ease); }
.fade-up.is-visible { opacity: 1; transform: translateY(0); }

/* ---------- MISC ---------- */
.text-center { text-align: center; }
.text-left { text-align: left; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.gap-2 { gap: var(--s-2); }
.gap-3 { gap: var(--s-3); }
.gap-4 { gap: var(--s-4); }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.mt-auto { margin-top: auto; }
.mb-3 { margin-bottom: var(--s-3); }
.mb-4 { margin-bottom: var(--s-4); }
.mb-6 { margin-bottom: var(--s-6); }
.mt-4 { margin-top: var(--s-4); }
.mt-6 { margin-top: var(--s-6); }
.mt-8 { margin-top: var(--s-8); }
.w-full { width: 100%; }
.hidden { display: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.toast { position: fixed; bottom: max(var(--s-6), env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: var(--s-3) var(--s-5); border-radius: var(--r-md); font-size: var(--t-sm); z-index: 200; box-shadow: 0 4px 24px rgba(0,0,0,0.15); animation: toastIn 0.3s var(--ease); }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 20px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* ---------- ASSISTANT CHAT ---------- */
.assistant-shell { display: flex; flex-direction: column; min-height: calc(100dvh - 56px); }
@media (min-width: 768px) { .assistant-shell { min-height: calc(100dvh - 64px); } }

.assistant-header { padding: var(--s-6) var(--s-5) var(--s-4); border-bottom: 1px solid var(--line); background: var(--bg); }
.assistant-header h1 { font-family: var(--font-display); font-size: var(--t-xl); margin-bottom: var(--s-1); display: flex; align-items: center; gap: var(--s-2); }
.assistant-header__sub { font-size: var(--t-xs); color: var(--ink-mute); }
.assistant-header__pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--success); display: inline-block; box-shadow: 0 0 0 3px rgba(31, 81, 40, 0.15); }

.assistant-disclaimer { background: var(--bg-deep); border-bottom: 1px solid var(--line); padding: var(--s-3) var(--s-5); font-size: var(--t-xs); color: var(--ink-soft); line-height: 1.5; }
.assistant-disclaimer strong { color: var(--ink); }

.assistant-messages { flex: 1; padding: var(--s-5); display: flex; flex-direction: column; gap: var(--s-4); padding-bottom: 180px; max-width: 760px; margin: 0 auto; width: 100%; }

.msg { display: flex; gap: var(--s-3); animation: fadeUp 0.3s var(--ease); }
.msg--user { justify-content: flex-end; }
.msg__bubble { max-width: 85%; padding: var(--s-3) var(--s-4); border-radius: var(--r-lg); font-size: var(--t-sm); line-height: 1.55; }
@media (min-width: 768px) { .msg__bubble { max-width: 75%; } }
.msg--user .msg__bubble { background: var(--ink); color: var(--bg); border-bottom-right-radius: 4px; }
.msg--assistant .msg__bubble { background: var(--bg-card); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.msg__bubble p { margin-bottom: var(--s-2); }
.msg__bubble p:last-child { margin-bottom: 0; }
.msg__bubble strong { font-weight: 600; }
.msg__bubble ul { margin: var(--s-2) 0; padding-left: var(--s-4); }
.msg__bubble ul li { padding: 2px 0; list-style: disc; }
.msg__bubble a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.msg--user .msg__bubble a { color: var(--bg); }

.msg__avatar { width: 32px; height: 32px; border-radius: 8px; background: var(--accent); flex-shrink: 0; display: flex; align-items: center; justify-content: center; position: relative; align-self: flex-end; }
.msg__avatar::after { content: ''; position: absolute; inset: 7px; border: 1.5px solid var(--bg); border-radius: 3px; }
.msg--user .msg__avatar { display: none; }

.msg__source { margin-top: var(--s-3); padding-top: var(--s-3); border-top: 1px solid var(--line); font-size: var(--t-xs); color: var(--ink-mute); }
.msg__source a { color: var(--accent); }

.msg__escalation { margin-top: var(--s-3); padding: var(--s-3); background: var(--accent-soft); border-radius: var(--r-md); font-size: var(--t-xs); color: var(--accent-deep); display: flex; gap: var(--s-2); align-items: flex-start; }
.msg__escalation strong { color: var(--accent); }

.msg__actions { display: flex; flex-wrap: wrap; gap: var(--s-2); margin-top: var(--s-3); }
.msg__action-btn { padding: 6px 12px; min-height: 32px; font-size: var(--t-xs); border: 1px solid var(--line-strong); border-radius: 999px; background: var(--bg); color: var(--ink); transition: all 0.2s var(--ease); }
.msg__action-btn:hover { background: var(--ink); color: var(--bg); border-color: var(--ink); }

.typing { display: inline-flex; gap: 4px; padding: 4px 0; }
.typing span { width: 6px; height: 6px; background: var(--ink-mute); border-radius: 50%; animation: typing 1.2s ease-in-out infinite; }
.typing span:nth-child(2) { animation-delay: 0.15s; }
.typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes typing { 0%, 60%, 100% { opacity: 0.3; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-4px); } }

.suggestions { padding: var(--s-2) 0; display: flex; flex-direction: column; gap: var(--s-2); }
.suggestions__title { font-family: var(--font-mono); font-size: var(--t-xs); color: var(--ink-mute); text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: var(--s-2); }
.suggestion { padding: var(--s-3) var(--s-4); background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--r-md); font-size: var(--t-sm); text-align: left; cursor: pointer; transition: all 0.15s var(--ease); display: flex; gap: var(--s-2); align-items: flex-start; min-height: 44px; }
.suggestion:hover { border-color: var(--ink); transform: translateY(-1px); }
.suggestion:active { transform: translateY(0); }
.suggestion__icon { color: var(--accent); flex-shrink: 0; width: 16px; height: 16px; margin-top: 2px; }

.assistant-input { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: var(--bg); border-top: 1px solid var(--line); padding: var(--s-3) var(--s-5) max(var(--s-3), env(safe-area-inset-bottom)); }
.assistant-input__wrap { max-width: 760px; margin: 0 auto; display: flex; gap: var(--s-2); align-items: flex-end; }
.assistant-input textarea { flex: 1; min-height: 48px; max-height: 120px; padding: var(--s-3) var(--s-4); background: var(--bg-card); border: 1px solid var(--line-strong); border-radius: var(--r-lg); font-family: inherit; font-size: var(--t-base); resize: none; line-height: 1.4; -webkit-appearance: none; appearance: none; }
.assistant-input textarea:focus { outline: none; border-color: var(--ink); }
.assistant-input button { width: 48px; height: 48px; min-height: 48px; padding: 0; flex-shrink: 0; background: var(--ink); color: var(--bg); border-radius: var(--r-lg); display: flex; align-items: center; justify-content: center; transition: all 0.2s var(--ease); }
.assistant-input button:hover:not(:disabled) { background: var(--accent); }
.assistant-input button:disabled { opacity: 0.4; cursor: not-allowed; }
.assistant-input__hint { max-width: 760px; margin: var(--s-2) auto 0; font-size: 10px; color: var(--ink-mute); text-align: center; }
