/* CurlDevis — feuille de style unique, sans dépendance externe. */
:root {
  --c-bg: #f6f7f9;
  --c-surface: #ffffff;
  --c-text: #1c2430;
  --c-muted: #5b6676;
  --c-border: #dde2e8;
  --c-primary: #4f46e5;
  --c-primary-dark: #4338ca;
  --c-primary-soft: #eef2ff;
  --c-ok: #1e7a4c;
  --c-ok-soft: #e5f4ec;
  --c-warn: #9a5b00;
  --c-warn-soft: #fff3dc;
  --c-danger: #b42318;
  --c-danger-soft: #fdecea;
  --c-info: #245c9e;
  --c-info-soft: #e7f0fb;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 16px; line-height: 1.55; color: var(--c-text); background: var(--c-bg); }
a { color: var(--c-primary); }
a:hover { color: var(--c-primary-dark); }
img { max-width: 100%; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; }
h1 { font-size: 1.75rem; }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.08rem; }
p { margin: 0 0 1em; }
:focus-visible { outline: 3px solid #f5b400; outline-offset: 2px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hp-field { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
[hidden] { display: none !important; }

.skip-link { position: absolute; left: -9999px; top: 0; background: #fff; padding: .5rem 1rem; z-index: 100; }
.skip-link:focus { left: 1rem; }

.container { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 1rem; }
.container-narrow { max-width: 760px; }
main { padding-block: 1.5rem 3rem; }

/* En-tête */
.site-header { background: var(--c-surface); border-bottom: 1px solid var(--c-border); position: sticky; top: 0; z-index: 20; }
.site-header .container { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 60px; flex-wrap: wrap; }
.brand { font-weight: 700; font-size: 1.1rem; color: var(--c-text); text-decoration: none; display: inline-flex; align-items: center; gap: .5rem; }
.brand-mark { width: 28px; height: 28px; border-radius: 8px; background: linear-gradient(120deg, #7c6cff, #4f8bff 45%, #22d3ee); color: #fff; display: inline-grid; place-items: center; font-size: .85rem; }
.nav { display: flex; align-items: center; gap: .25rem; flex-wrap: wrap; }
.nav a, .nav button.linklike { padding: .45rem .7rem; border-radius: 8px; text-decoration: none; color: var(--c-text); font-size: .95rem; }
.nav a:hover, .nav a[aria-current="page"] { background: var(--c-primary-soft); color: var(--c-primary-dark); }
.nav form { margin: 0; }
.site-header .nav-toggle { display: none; }
@media (max-width: 760px) {
  .site-header .nav-toggle { display: inline-flex; }
  .nav { display: none; width: 100%; flex-direction: column; align-items: stretch; padding-bottom: .75rem; }
  .nav.is-open { display: flex; }
  .nav a, .nav .btn, .nav button.linklike { width: 100%; text-align: left; }
}

/* Boutons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; padding: .6rem 1rem; border-radius: 8px; border: 1px solid transparent;
  font: inherit; font-weight: 600; font-size: .95rem; cursor: pointer; text-decoration: none; line-height: 1.2; background: var(--c-primary); color: #fff; }
.btn:hover { background: var(--c-primary-dark); color: #fff; }
.btn-secondary { background: var(--c-surface); color: var(--c-text); border-color: var(--c-border); }
.btn-secondary:hover { background: #eef1f5; color: var(--c-text); }
.btn-ghost { background: transparent; color: var(--c-primary); }
.btn-ghost:hover { background: var(--c-primary-soft); color: var(--c-primary-dark); }
.btn-danger { background: var(--c-danger); }
.btn-danger:hover { background: #8f1c13; }
.btn-ok { background: var(--c-ok); }
.btn-ok:hover { background: #155c39; }
.btn-sm { padding: .35rem .65rem; font-size: .85rem; }
.btn-lg { padding: .8rem 1.3rem; font-size: 1.05rem; }
.btn[disabled], .btn.is-loading { opacity: .6; cursor: not-allowed; }
button.linklike { background: none; border: 0; font: inherit; cursor: pointer; color: var(--c-primary); padding: 0; }
.btn-row { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }

/* Cartes et grilles */
.card { background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius); padding: 1.25rem; box-shadow: var(--shadow); }
.card + .card { margin-top: 1rem; }
.card-header { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: .75rem; }
.card-header h2, .card-header h3 { margin: 0; }
.grid { display: grid; gap: 1rem; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.layout-main { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 1rem; align-items: start; }
@media (max-width: 900px) { .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid-3, .layout-main { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .grid-2, .grid-4 { grid-template-columns: 1fr; } }
.stack > * + * { margin-top: 1rem; }

.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.page-head h1 { margin: 0; }
.page-head p { margin: .25rem 0 0; color: var(--c-muted); }

/* Indicateurs */
.kpi { background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius); padding: 1rem 1.1rem; box-shadow: var(--shadow); }
.kpi-label { font-size: .85rem; color: var(--c-muted); }
.kpi-value { font-size: 1.6rem; font-weight: 700; margin-top: .15rem; }
.kpi-sub { font-size: .82rem; color: var(--c-muted); }
.kpi-warn { border-left: 4px solid #e0a100; }
.kpi-ok { border-left: 4px solid var(--c-ok); }

/* Badges */
.badge { display: inline-block; padding: .12rem .55rem; border-radius: 999px; font-size: .78rem; font-weight: 600; white-space: nowrap; }
.badge-info { background: var(--c-info-soft); color: var(--c-info); }
.badge-warn { background: var(--c-warn-soft); color: var(--c-warn); }
.badge-ok { background: var(--c-ok-soft); color: var(--c-ok); }
.badge-danger { background: var(--c-danger-soft); color: var(--c-danger); }
.badge-muted { background: #eef0f3; color: #4a5361; }
.badge-demo { background: #f1e8ff; color: #5b2a99; }
.badge-ai { background: #fff0e0; color: #8a4a00; }

/* Alertes et bandeaux */
.messages { list-style: none; padding: 0; margin: 0 0 1rem; }
.alert { padding: .8rem 1rem; border-radius: 8px; border: 1px solid; margin-bottom: .6rem; }
.alert-success { background: var(--c-ok-soft); border-color: #b5dfc8; color: #124d30; }
.alert-error { background: var(--c-danger-soft); border-color: #f3c2bd; color: #7a1810; }
.alert-info, .alert-debug { background: var(--c-info-soft); border-color: #c3d7f1; color: #1a426f; }
.alert-warning { background: var(--c-warn-soft); border-color: #f1d49a; color: #6b4000; }
.banner { padding: .55rem 0; font-size: .92rem; border-bottom: 1px solid var(--c-border); }
.banner .container { display: flex; gap: 1rem; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.banner-trial { background: var(--c-info-soft); }
.banner-warn { background: var(--c-warn-soft); }
.banner-danger { background: var(--c-danger-soft); }
.banner-test { background: #fff7d6; text-align: center; font-size: .85rem; }

/* Tableaux */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.table { width: 100%; border-collapse: collapse; font-size: .94rem; }
.table th, .table td { text-align: left; padding: .65rem .6rem; border-bottom: 1px solid var(--c-border); vertical-align: top; }
.table th { font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; color: var(--c-muted); font-weight: 600; }
.table tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; white-space: nowrap; }
.table a.row-link { font-weight: 600; text-decoration: none; }
.table a.row-link:hover { text-decoration: underline; }
.row-rejected td { background: #fff8f7; }
@media (max-width: 700px) {
  .table-cards thead { display: none; }
  .table-cards tr { display: block; border-bottom: 1px solid var(--c-border); padding: .6rem 0; }
  .table-cards td { display: flex; justify-content: space-between; gap: 1rem; border: 0; padding: .2rem .25rem; }
  .table-cards td::before { content: attr(data-label); color: var(--c-muted); font-size: .82rem; }
  .table-cards .num { text-align: right; }
}

/* Formulaires */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem 1.25rem; }
.form-grid .span-2 { grid-column: 1 / -1; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }
.field { display: flex; flex-direction: column; gap: .3rem; }
.field label, .field legend { font-weight: 600; font-size: .93rem; }
.field .required { color: var(--c-danger); }
.field .help { font-size: .83rem; color: var(--c-muted); }
.field .error, .errorlist { color: var(--c-danger); font-size: .86rem; margin: 0; padding: 0; list-style: none; }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=search], input[type=number], input[type=tel], input:not([type]), select, textarea {
  width: 100%; padding: .6rem .7rem; border: 1px solid #c4ccd6; border-radius: 8px; font: inherit; background: #fff; color: var(--c-text); }
textarea { resize: vertical; min-height: 6rem; }
input[aria-invalid=true], select[aria-invalid=true], textarea[aria-invalid=true] { border-color: var(--c-danger); }
.checkbox { display: flex; gap: .55rem; align-items: flex-start; font-weight: 400; }
.checkbox input { margin-top: .3rem; width: 1.05rem; height: 1.05rem; flex: none; }
.radio-list { list-style: none; padding: 0; margin: 0; display: flex; gap: 1rem; flex-wrap: wrap; }
.radio-list label { font-weight: 400; display: flex; gap: .4rem; align-items: center; }
.filters { display: grid; grid-template-columns: 2fr 1fr 1fr auto; gap: .75rem; align-items: end; }
@media (max-width: 760px) { .filters { grid-template-columns: 1fr; } }
.form-actions { display: flex; gap: .6rem; flex-wrap: wrap; margin-top: 1.25rem; }

/* États vides */
.empty { text-align: center; padding: 2rem 1rem; color: var(--c-muted); }
.empty h3 { color: var(--c-text); }

/* Liste de démarrage */
.checklist { list-style: none; padding: 0; margin: 0; }
.checklist li { display: flex; gap: .75rem; align-items: flex-start; padding: .6rem 0; border-bottom: 1px solid var(--c-border); }
.checklist li:last-child { border-bottom: 0; }
.check { flex: none; width: 1.5rem; height: 1.5rem; border-radius: 50%; border: 2px solid #b8c1cc; display: grid; place-items: center; font-size: .8rem; font-weight: 700; }
.check.done { background: var(--c-ok); border-color: var(--c-ok); color: #fff; }
.checklist .done-label { text-decoration: line-through; color: var(--c-muted); }
.progress { height: 8px; background: #e7ebf0; border-radius: 999px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--c-ok); }
.progress-0 > span { width: 0; } .progress-1 > span { width: 20%; } .progress-2 > span { width: 40%; }
.progress-3 > span { width: 60%; } .progress-4 > span { width: 80%; } .progress-5 > span { width: 100%; }

/* Liste « à relancer » */
.task-list { list-style: none; margin: 0; padding: 0; }
.task { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .75rem 0; border-bottom: 1px solid var(--c-border); flex-wrap: wrap; }
.task:last-child { border-bottom: 0; }
.task-title { font-weight: 600; }
.task-meta { font-size: .86rem; color: var(--c-muted); }
.late { color: var(--c-danger); font-weight: 600; }

/* Historique */
.timeline { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--c-border); }
.timeline li { position: relative; padding: 0 0 1rem 1rem; }
.timeline li::before { content: ""; position: absolute; left: -7px; top: .45rem; width: 12px; height: 12px; border-radius: 50%; background: var(--c-surface); border: 2px solid var(--c-primary); }
.timeline .when { font-size: .82rem; color: var(--c-muted); }
.timeline pre { white-space: pre-wrap; font: inherit; font-size: .88rem; background: #f7f8fa; border: 1px solid var(--c-border); border-radius: 8px; padding: .6rem; margin: .4rem 0 0; max-height: 14rem; overflow: auto; }

dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: .4rem 1rem; margin: 0; }
dl.facts dt { color: var(--c-muted); font-size: .9rem; }
dl.facts dd { margin: 0; }
.muted { color: var(--c-muted); }
.small { font-size: .86rem; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: .5rem; } .mt-2 { margin-top: 1rem; } .mt-3 { margin-top: 1.5rem; }
.mb-0 { margin-bottom: 0; }
.text-right { text-align: right; }
.tabs { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: 1rem; }
.tabs a { padding: .4rem .8rem; border-radius: 999px; border: 1px solid var(--c-border); text-decoration: none; color: var(--c-text); background: var(--c-surface); font-size: .9rem; }
.tabs a[aria-current="true"] { background: var(--c-primary); border-color: var(--c-primary); color: #fff; }
.notice { background: #f7f8fa; border: 1px dashed #c4ccd6; border-radius: 8px; padding: .75rem 1rem; font-size: .9rem; color: var(--c-muted); }
.draft-flag { background: #fff3dc; border: 1px solid #f1d49a; color: #6b4000; border-radius: 8px; padding: .75rem 1rem; margin-bottom: 1.25rem; font-size: .92rem; }
.pagination { display: flex; gap: .5rem; align-items: center; justify-content: center; margin-top: 1rem; flex-wrap: wrap; }

/* Assistant */
.chat-output { white-space: pre-wrap; background: #f7f8fa; border: 1px solid var(--c-border); border-radius: 8px; padding: .8rem; min-height: 3rem; }
.chat-output:empty { display: none; }
.ai-suggestion { border: 1px solid #f1d49a; background: #fffaf0; border-radius: 8px; padding: .8rem; }

/* Site de présentation */
.hero { padding: 3.5rem 0 2.5rem; }
.hero h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); max-width: 18ch; }
.hero .lead { font-size: 1.15rem; color: var(--c-muted); max-width: 60ch; }
.hero-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 2rem; align-items: center; }
@media (max-width: 900px) { .hero-grid { grid-template-columns: 1fr; } }
.section { padding: 2.5rem 0; }
.section-alt { background: var(--c-surface); border: 1px solid var(--c-border); border-radius: 14px; }
.container .container { padding: 0 1.25rem; max-width: none; }
.section h2 { font-size: 1.55rem; }
.feature { padding: 1.1rem; border-radius: var(--radius); background: var(--c-surface); border: 1px solid var(--c-border); }
.feature h3 { margin-bottom: .3rem; }
.steps { counter-reset: step; list-style: none; padding: 0; margin: 0; display: grid; gap: 1rem; grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 900px) { .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .steps { grid-template-columns: 1fr; } }
.steps li { counter-increment: step; background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius); padding: 1rem; }
.steps li::before { content: counter(step); display: inline-grid; place-items: center; width: 2rem; height: 2rem; border-radius: 50%; background: var(--c-primary); color: #fff; font-weight: 700; margin-bottom: .5rem; }
.mock { background: var(--c-surface); border: 1px solid var(--c-border); border-radius: 14px; box-shadow: 0 10px 30px rgba(16, 24, 40, .08); padding: 1rem; }
.mock-caption { font-size: .8rem; color: var(--c-muted); margin-top: .5rem; text-align: center; }
.price-card { text-align: left; }
.price { font-size: 2.2rem; font-weight: 700; }
.price small { font-size: 1rem; font-weight: 400; color: var(--c-muted); }
.price-card ul { padding-left: 1.1rem; }
.faq details { background: var(--c-surface); border: 1px solid var(--c-border); border-radius: 8px; padding: .8rem 1rem; }
.faq details + details { margin-top: .6rem; }
.faq summary { font-weight: 600; cursor: pointer; }
.faq details p { margin: .6rem 0 0; }
.site-footer { border-top: 1px solid var(--c-border); background: var(--c-surface); padding: 1.5rem 0; font-size: .9rem; color: var(--c-muted); }
.site-footer .container { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.site-footer nav { display: flex; gap: 1rem; flex-wrap: wrap; }
.auth-card { max-width: 440px; margin: 2rem auto; }
.legal h2 { margin-top: 1.5rem; }
