/* Site public CaptDoc (accueil, tarifs, pages légales, inscription), en complément de app.css. Même charte : voir docs/design.md. */

.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 16px; top: -48px; z-index: 20; padding: 8px 12px; border-radius: 6px; background: var(--surface); border: 1px solid var(--border); font-weight: 500; }
.skip-link:focus { top: 8px; }

.site { overflow-x: hidden; }
.site .container { padding-left: 16px; padding-right: 16px; }
@media (min-width: 768px) { .site .container { padding-left: 24px; padding-right: 24px; } }

/* En-tête : connexion et inscription dans le tiroir sur petit écran. */
.site-mark { flex-shrink: 0; color: var(--text); }
.site-nav__login, .site-nav__signup { display: none; }
.drawer__cta { margin-top: 4px; color: var(--primary-text); }
.drawer__panel a.drawer__cta:hover { color: var(--primary-text); background: var(--primary-hover); }
@media (min-width: 480px) { .site-nav__signup { display: inline-flex; } }
@media (min-width: 768px) { .site-nav__login { display: inline-flex; } }

/* Sections */
.site-section { padding-top: 48px; }
.site-section--first { padding-top: 32px; }
@media (min-width: 768px) { .site-section { padding-top: 64px; } .site-section--first { padding-top: 48px; } }
@media (min-width: 1024px) { .site-section { padding-top: 96px; } }
.site-section__title { font-size: 28px; letter-spacing: -0.03em; max-width: 24ch; }
@media (min-width: 768px) { .site-section__title { font-size: 32px; } }
.site-section__head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.site-section__foot { margin-top: 12px; }
.site-lead { margin-top: 16px; max-width: 60ch; font-size: 17px; color: var(--text-2); }

/* Accueil : en-tête */
.hero { display: grid; gap: 40px; padding-top: 40px; }
@media (min-width: 960px) { .hero { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); align-items: center; gap: 64px; padding-top: 80px; } }
.hero__title { font-size: 36px; line-height: 1.08; letter-spacing: -0.04em; max-width: 16ch; }
@media (min-width: 768px) { .hero__title { font-size: 52px; } }
@media (min-width: 1280px) { .hero__title { font-size: 60px; } }
.hero__lead { margin-top: 20px; max-width: 54ch; font-size: 17px; color: var(--text-2); }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.hero__note { margin-top: 16px; }
@media (max-width: 479px) { .hero__actions .btn { width: 100%; } }

/* Accueil : facture stylisée et champs extraits */
.specimen { position: relative; margin: 0; display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 560px) { .specimen { grid-template-columns: 200px minmax(0, 1fr); align-items: center; gap: 24px; } }
@media (min-width: 1024px) { .specimen { grid-template-columns: 240px minmax(0, 1fr); } }
.specimen__doc { display: none; }
@media (min-width: 560px) { .specimen__doc { display: block; } }
.specimen__doc svg { display: block; width: 100%; height: auto; }
.specimen__hl { fill: #ECFDF5; stroke: #10B981; stroke-width: 1; }
.specimen__hl--review { fill: #FFFBEB; stroke: #F59E0B; }
.specimen__fields { margin: 0; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 8px 0; font-family: var(--font-code); font-size: 13px; }
.specimen__row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 16px; border-left: 2px solid #10B981; margin-left: -1px; }
.specimen__row + .specimen__row { border-top: 1px dashed var(--border); }
.specimen__row dt { color: var(--text-2); white-space: nowrap; }
.specimen__row dd { margin: 0; display: inline-flex; align-items: center; gap: 8px; text-align: right; color: var(--text); font-variant-numeric: tabular-nums; }
.specimen__row--review { border-left-color: #F59E0B; }
.specimen__row .chip { font-family: var(--font-body); }
.specimen__caption { grid-column: 1 / -1; }
@media (prefers-reduced-motion: no-preference) {
  .specimen__row { animation: specimen-in 480ms cubic-bezier(.2, .7, .2, 1) both; }
  .specimen__row:nth-child(2) { animation-delay: 80ms; }
  .specimen__row:nth-child(3) { animation-delay: 160ms; }
  .specimen__row:nth-child(4) { animation-delay: 240ms; }
  .specimen__row:nth-child(5) { animation-delay: 320ms; }
  .specimen__row:nth-child(6) { animation-delay: 480ms; }
}
@keyframes specimen-in { from { opacity: 0; transform: translateX(-8px); } to { opacity: 1; transform: none; } }

/* Accueil : étapes */
.steps { list-style: none; margin: 32px 0 0; padding: 0; display: grid; gap: 32px; }
@media (min-width: 768px) { .steps { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; } }
.step { padding-top: 16px; border-top: 1px solid var(--text); }
.step__num { display: block; margin-bottom: 16px; font-family: var(--font-code); font-size: 13px; color: var(--text-2); }
.step h3 { font-size: 18px; }
.step p { margin-top: 8px; color: var(--text-2); }

/* Accueil : fonctionnalités */
.features { list-style: none; margin: 32px 0 0; padding: 0; display: grid; gap: 0 24px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 640px) { .features { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .features { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.feature { padding: 20px 0 24px; border-top: 1px solid var(--border); }
.feature h3 { font-size: 16px; }
.feature p { margin-top: 8px; color: var(--text-2); }

/* Aperçu des forfaits */
.plan-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.plan-table th, .plan-table td { padding: 12px 16px; text-align: left; border-top: 1px solid var(--border); }
.plan-table thead th { border-top: 0; font-size: 12px; font-weight: 500; color: var(--text-2); }
.plan-table tbody th { font-weight: 500; }
.plan-table .num { text-align: right; font-family: var(--font-code); font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.plan-table thead .num { font-family: var(--font-body); font-size: 12px; white-space: normal; }
@media (min-width: 768px) { .plan-table th, .plan-table td { padding: 12px 24px; } }

/* Appel à l'action */
.cta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 24px; padding: 32px 24px; background: var(--bg-alt); border: 1px solid var(--border); border-radius: 12px; }
.cta p { margin-top: 8px; max-width: 56ch; }
@media (min-width: 768px) { .cta { padding: 40px; } }
@media (max-width: 479px) { .cta .btn { width: 100%; } }

/* Tarifs */
.pricing__terms { margin-top: 12px; }

/* Questions fréquentes */
.faq { margin-top: 24px; max-width: 760px; border-top: 1px solid var(--border); }
.faq__item { border-bottom: 1px solid var(--border); }
.faq__item > summary { position: relative; padding: 16px 32px 16px 0; font-weight: 500; }
.faq__item > summary::after { content: "+"; position: absolute; right: 4px; top: 14px; font-family: var(--font-code); font-size: 16px; color: var(--text-2); }
.faq__item[open] > summary::after { content: "−"; }
.faq__item > summary:focus-visible { box-shadow: var(--ring); }
.faq__item p { padding: 0 0 16px; max-width: 64ch; color: var(--text-2); }

/* Pages légales provisoires */
.legal__draft { margin-bottom: 24px; }
.legal__sections { margin: 32px 0 0; padding: 0; list-style: none; counter-reset: legal; max-width: 760px; }
.legal__sections li { counter-increment: legal; padding: 16px 0; border-top: 1px solid var(--border); }
.legal__sections h2 { font-size: 18px; }
.legal__sections h2::before { content: counter(legal) ". "; font-family: var(--font-code); font-size: 14px; color: var(--text-2); }
.legal__sections p { margin-top: 4px; font-size: 14px; }

/* Inscription */
.checkbox { display: flex; align-items: flex-start; gap: 12px; font-size: 14px; }
.checkbox input { flex-shrink: 0; width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--primary); }

/* Pied de page */
.site-footer { margin-top: 64px; padding: 32px 0; border-top: 1px solid var(--border); background: var(--surface); }
.site-footer__inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; }
.site-footer__brand { font-family: var(--font-display); font-weight: 700; letter-spacing: -0.03em; }
.site-footer__links { display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: 14px; }

/* Accueil : schéma animé du parcours d'un document (site/_flow). */
.flow { margin: 24px 0 0; padding: 24px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; }
@media (min-width: 768px) { .flow { padding: 32px; } }
.flow__svg { display: block; width: 100%; height: auto; font-family: var(--font-body); }
.flow__svg--wide { display: none; }
@media (min-width: 720px) { .flow__svg--wide { display: block; } .flow__svg--compact { display: none; } }
.flow__link { stroke: #C7C7F5; stroke-width: 2; }
.flow__link--paid { stroke: #D4D4DA; stroke-dasharray: 5 5; }
.flow__node rect { fill: var(--surface); stroke: var(--primary); stroke-width: 1.5; }
.flow__node--paid rect { stroke: var(--neutral); stroke-dasharray: 5 4; }
.flow__link--soon { stroke: #E4E4E8; }
.flow__node--soon > rect { stroke: #C9C9CF; }
.flow__node--soon .flow__label { fill: var(--text-2); }
.flow__soon rect { fill: #FFFBEB; stroke: #FDE68A; stroke-dasharray: none; }
.flow__soon text { fill: #B45309; font-weight: 600; letter-spacing: 0.02em; }
.flow__label { fill: var(--text); font-weight: 600; }
.flow__sub, .flow__stage text.flow__sub { fill: var(--text-2); font-weight: 400; }
.flow__core > rect { fill: #EEF2FF; stroke: var(--primary); stroke-width: 1.5; }
.flow__core-title { fill: var(--primary); font-family: var(--font-display); font-weight: 600; letter-spacing: -0.02em; }
.flow__stage rect { fill: var(--surface); stroke: var(--border); }
.flow__stage text { fill: var(--text); font-weight: 500; }
.flow__lane--ai rect { stroke: #C7C7F5; }
.flow__lane--ocr rect { stroke: #F5D9A8; }
.flow__icon { fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.flow__lane--ai .flow__icon { stroke: var(--primary); }
.flow__lane--ocr .flow__icon { stroke: #B45309; }
.flow__stage--match text { font-weight: 600; }
.flow__wires path { stroke: #C9C9CF; stroke-width: 1.5; }
.flow__pulse--ai { fill: var(--primary); }
.flow__pulse--ocr { fill: var(--warning); }
.flow__dot rect { stroke: none; }
.flow__dot--in rect { fill: var(--primary); }
.flow__dot--out rect { fill: var(--success); }
.flow__dot-lines { stroke: #FFFFFF; stroke-width: 1.2; stroke-linecap: round; fill: none; }
.flow__legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 24px; margin-top: 16px; }
.flow__key { display: inline-flex; align-items: center; gap: 8px; }
.flow__swatch { width: 24px; height: 0; border-top: 2px solid var(--primary); }
.flow__swatch--paid { border-top: 2px dashed var(--neutral); }
@media (prefers-reduced-motion: no-preference) {
  .flow__stage rect { animation: flow-stage 2.4s ease-in-out infinite backwards; }
  .flow__lane--ai rect { animation-name: flow-lane-ai; }
  .flow__lane--ocr rect { animation-name: flow-lane-ocr; }
}
/* Fenêtre allumée de 10 à 30 % du tour ; les délais en ligne enchaînent les étapes. */
@keyframes flow-stage {
  0%, 40%, 100% { fill: var(--surface); stroke: var(--border); }
  10%, 30% { fill: #ECFDF5; stroke: var(--success); }
}
@keyframes flow-lane-ai {
  0%, 40%, 100% { fill: var(--surface); stroke: #C7C7F5; }
  10%, 30% { fill: #EEF2FF; stroke: var(--primary); }
}
@keyframes flow-lane-ocr {
  0%, 40%, 100% { fill: var(--surface); stroke: #F5D9A8; }
  10%, 30% { fill: #FFFBEB; stroke: var(--warning); }
}
@media (prefers-reduced-motion: reduce) { .flow__dots { display: none; } }

/* Accueil : consignes de lecture par fournisseur. */
.tuning { display: grid; gap: 32px; }
@media (min-width: 960px) { .tuning { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); align-items: center; gap: 64px; } }
.tuning__points { margin: 24px 0 0; padding-left: 20px; display: grid; gap: 10px; color: var(--text-2); max-width: 60ch; }
.tuning__examples { margin: 0; }
.tuning__examples ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.tuning__examples .caption { margin-top: 12px; }
.directive { background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--primary); border-radius: 12px; padding: 14px 16px; }
.directive p { margin-top: 6px; color: var(--text); }
.directive__scope { display: inline-flex; align-items: center; height: 22px; padding: 0 10px; border-radius: 9999px; background: #EEF2FF; color: var(--primary); font-size: 12px; font-weight: 600; }
.directive__scope--all { background: var(--bg-alt); color: var(--text-2); }

.site-section__head + .estimator { margin-top: 0; }
.compare { margin-top: 24px; }
.compare summary { cursor: pointer; font-weight: 500; color: var(--primary); }
.compare__card { margin-top: 16px; overflow-x: auto; }
