/* DocOnline.fr — feuille de style de la démo (sans étape de build) */

:root {
    --ink: #14212b;
    --ink-soft: #4a5a66;
    --muted: #7a8893;
    --line: #dde3e8;
    --bg: #f4f6f8;
    --surface: #ffffff;
    --brand: #12344d;
    --accent: #0f8b8d;
    --accent-dark: #0b6d6f;
    --ok: #1d7a46;
    --ok-bg: #e5f4ea;
    --warn: #9a6200;
    --warn-bg: #fdf2dc;
    --danger: #b3261e;
    --danger-bg: #fbe7e5;
    --radius: 10px;
    --shadow: 0 1px 2px rgba(20, 33, 43, .06), 0 2px 8px rgba(20, 33, 43, .05);
    --font: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
    --mono: ui-monospace, "Cascadia Mono", Consolas, monospace;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--bg); line-height: 1.5; font-size: 15px; }
a { color: var(--accent-dark); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .4em; }
h1 { font-size: 1.7rem; letter-spacing: -.01em; }
h2 { font-size: 1.1rem; }
code { font-family: var(--mono); font-size: .9em; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 20px; }
.main { padding-top: 28px; padding-bottom: 40px; min-height: 70vh; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.center { text-align: center; }
.strong { font-weight: 600; }
.req { color: var(--danger); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Barre du haut */
.topbar { background: var(--brand); color: #fff; }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; height: 58px; gap: 16px; }
.brand { color: #fff; text-decoration: none; font-weight: 700; font-size: 1.15rem; letter-spacing: -.01em; }
.brand-mark { color: #6fd3d4; margin-right: 4px; }
.brand-tld { opacity: .6; font-weight: 400; }
.topnav { display: flex; align-items: center; gap: 18px; }
.topnav a, .link-button { color: #d6e2ea; text-decoration: none; font-size: .95rem; }
.topnav a.active, .topnav a:hover, .link-button:hover { color: #fff; }
.topnav form { margin: 0; }
.topnav-user { color: #9fb4c3; font-size: .9rem; }
.link-button { background: none; border: 0; padding: 0; cursor: pointer; font: inherit; }
.footer { color: var(--muted); font-size: .85rem; padding-top: 16px; padding-bottom: 28px; border-top: 1px solid var(--line); }

/* Boutons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; background: var(--accent); color: #fff; border: 1px solid var(--accent);
       border-radius: 8px; padding: 9px 16px; font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-ghost { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: #eef2f5; border-color: #c9d2d9; }
.btn-danger { background: var(--danger); border-color: var(--danger); }
.btn-danger:hover { background: #8f1e18; border-color: #8f1e18; }
.btn-small { padding: 5px 11px; font-size: .88rem; }
.btn-block { display: flex; width: 100%; }
.btn-large { padding: 14px 18px; font-size: 1.05rem; flex-direction: column; gap: 2px; }
.btn-sub { font-weight: 400; font-size: .82rem; opacity: .85; }
.icon-button { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 1rem; padding: 4px 6px; border-radius: 6px; }
.icon-button:hover { color: var(--danger); background: var(--danger-bg); }

/* Messages */
.flash { border-radius: 8px; padding: 10px 14px; margin: 0 0 18px; }
.flash ul { margin: 0; padding-left: 18px; }
.flash-ok { background: var(--ok-bg); color: var(--ok); }
.flash-error { background: var(--danger-bg); color: var(--danger); }
.hint { font-size: .9rem; border-radius: 6px; padding: 6px 10px; }
.hint-warn { background: var(--warn-bg); color: var(--warn); }

/* Cartes et mise en page */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.card-narrow { max-width: 420px; margin: 20px auto; }
.card-medium { max-width: 680px; margin: 0 auto 20px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 20px; }
.page-head p { margin: 0; }
.description { margin-top: 6px !important; color: var(--ink-soft); max-width: 70ch; }
.breadcrumb { font-size: .88rem; color: var(--muted); margin: 0 0 8px; }
.breadcrumb a { color: var(--muted); }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.stack { display: grid; gap: 20px; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 12px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.actions form { margin: 0; }
.danger-zone { border-color: #efc9c5; }

/* Formulaires */
.form { display: grid; gap: 14px; }
.form label { display: grid; gap: 5px; font-weight: 600; font-size: .92rem; }
.form label .muted { font-weight: 400; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 6px; }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=search], textarea, select {
    width: 100%; font: inherit; color: var(--ink); background: #fff; border: 1px solid #c9d2d9; border-radius: 7px; padding: 8px 10px; font-weight: 400;
}
input:focus, textarea:focus, select:focus { outline: 2px solid rgba(15, 139, 141, .35); border-color: var(--accent); }
.checkbox { display: flex !important; align-items: center; gap: 8px; font-weight: 400 !important; }
.checkbox input { width: 16px; height: 16px; }

/* Tableau de bord */
.stats { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 14px; margin-bottom: 18px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; display: grid; gap: 4px; }
.stat-label { color: var(--muted); font-size: .82rem; text-transform: uppercase; letter-spacing: .04em; }
.stat-value { font-size: 1.4rem; font-weight: 700; }
.stat-value small { font-size: .9rem; font-weight: 400; color: var(--muted); }
.gauge { height: 8px; background: #e6ebef; border-radius: 99px; overflow: hidden; margin-top: 4px; }
.gauge-fill { height: 100%; background: var(--accent); border-radius: 99px; }
.gauge-warn { background: #d08a00; }
.search { margin-bottom: 14px; max-width: 420px; }
.table-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--line); }
.table th { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; background: #fafbfc; }
.table tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.badge { display: inline-block; font-size: .78rem; font-weight: 600; padding: 2px 9px; border-radius: 99px; }
.badge-ok { background: var(--ok-bg); color: var(--ok); }
.badge-warning { background: var(--warn-bg); color: var(--warn); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-muted { background: #edf0f2; color: var(--ink-soft); }
.empty { text-align: center; padding: 50px 20px; background: var(--surface); border: 1px dashed #c9d2d9; border-radius: var(--radius); }
.empty-inline { color: var(--muted); text-align: center; padding: 14px 0 4px; }

/* Dépôt de fichiers */
.dropzone { position: relative; border: 2px dashed #b9c5ce; border-radius: var(--radius); background: #f8fafb; text-align: center; margin-bottom: 14px; transition: background .15s, border-color .15s; }
.dropzone input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.dropzone-label { display: block; padding: 22px 16px; cursor: pointer; }
.dropzone.is-over { border-color: var(--accent); background: #e9f6f6; }
.dropzone.is-busy { opacity: .6; pointer-events: none; }

/* Liste des documents */
.doc-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.doc { display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto auto; align-items: center; gap: 8px; padding: 6px 8px;
       border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.doc form { margin: 0; }
.doc.is-dragging { opacity: .45; }
.doc.drop-before { box-shadow: 0 -3px 0 var(--accent); }
.doc.drop-after { box-shadow: 0 3px 0 var(--accent); }
.doc-handle { cursor: grab; color: var(--muted); font-size: 1.1rem; padding: 0 2px; user-select: none; }
.doc-type { font-size: .68rem; font-weight: 700; color: var(--brand); background: #e7eef3; border-radius: 4px; padding: 2px 5px; }
.doc-title input { border-color: transparent; background: transparent; padding: 5px 6px; }
.doc-title input:hover { border-color: var(--line); }
.doc-title input.is-saved { border-color: var(--ok); }
.doc-meta { font-size: .8rem; color: var(--muted); white-space: nowrap; }
.doc-invalid { border-color: #efc9c5; background: #fffafa; }
.doc-error { grid-column: 1 / -1; margin: 0; font-size: .82rem; color: var(--danger); padding-left: 30px; }

/* PDF compilé */
.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 0; }
.facts div { background: #f6f8fa; border-radius: 8px; padding: 8px 10px; }
.facts dt { font-size: .75rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.facts dd { margin: 0; font-weight: 600; }

/* Aperçu d'étiquette (100 × 60 mm → ratio 5:3) */
.label-preview { display: grid; grid-template-columns: 62fr 38fr; grid-template-rows: 1fr auto; aspect-ratio: 100 / 60; width: 100%; max-width: 420px;
                 border: 2px solid #000; background: #fff; color: #000; font-family: "DejaVu Sans", Verdana, sans-serif; margin: 4px auto 14px; }
.lp-fields { display: grid; grid-template-rows: 22% 15% 1fr; border-right: 1px solid #000; min-width: 0; }
.lp-field { border-bottom: 1px solid #000; padding: 3px 6px; overflow: hidden; font-size: .78rem; line-height: 1.25; }
.lp-field:last-child { border-bottom: 0; }
.lp-field span { display: block; font-size: .55rem; text-transform: uppercase; color: #555; letter-spacing: .03em; }
.lp-field strong { font-size: .9rem; }
.lp-desc { font-size: .68rem; }
.lp-qr { display: flex; align-items: center; justify-content: center; padding: 6%; }
.lp-qr svg { width: 100%; height: auto; display: block; }
.lp-footer { grid-column: 1 / -1; border-top: 1px solid #000; text-align: center; font-size: .66rem; padding: 4px; }
.lp-qr-sample { background:
    linear-gradient(90deg, #000 0 28%, transparent 28% 72%, #000 72%) top/100% 28% no-repeat,
    linear-gradient(90deg, #000 0 28%, transparent 28%) bottom/100% 28% no-repeat,
    repeating-conic-gradient(#000 0 25%, #fff 0 50%) center/18% 18%;
    margin: 12%; }
.label-form { display: flex; gap: 8px; flex-wrap: wrap; }
.label-form select { flex: 1 1 200px; width: auto; }
.public-link { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.copy-row { display: flex; gap: 6px; margin: 4px 0; }
.copy-row input { font-family: var(--mono); font-size: .85rem; }

/* Accueil */
.hero { display: grid; grid-template-columns: 1.3fr 1fr; gap: 40px; align-items: center; padding: 30px 0 40px; }
.hero h1 { font-size: 2.3rem; }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: .78rem; color: var(--accent); font-weight: 700; margin: 0 0 8px; }
.lead { font-size: 1.1rem; color: var(--ink-soft); max-width: 56ch; }
.hero-actions { display: flex; gap: 10px; margin-top: 20px; }
.label-sample { transform: rotate(-2deg); box-shadow: 0 14px 30px rgba(20, 33, 43, .18); }
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.step { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.step p { margin: 0; color: var(--ink-soft); }
.step-n { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--brand); color: #fff; font-weight: 700; margin-bottom: 8px; }

/* Page publique (scan du QR, pensée pour mobile) */
body.public { background: #eef2f5; }
.pub-wrap { max-width: 560px; margin: 0 auto; padding: 20px 16px 30px; }
.pub { background: var(--surface); border-radius: 14px; padding: 22px 20px; box-shadow: var(--shadow); }
.pub-head h1 { font-size: 1.5rem; }
.pub-meta { color: var(--muted); margin: 0; }
.pub-desc { color: var(--ink-soft); margin: 10px 0 0; }
.pub-actions { display: grid; gap: 10px; margin: 20px 0; }
.pub-toc h2 { font-size: .85rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.pub-toc ol { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.pub-toc li a { display: flex; justify-content: space-between; gap: 12px; padding: 12px 2px; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.pub-toc li a:hover { color: var(--accent-dark); }
.pub-page { color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.pub-updated { color: var(--muted); font-size: .85rem; margin: 16px 0 0; }
.pub-pending { text-align: center; padding: 24px 6px; }
.pub-footer { text-align: center; color: var(--muted); font-size: .82rem; padding: 0 16px 30px; }
.pub-footer a { color: var(--muted); }

@media (max-width: 900px) {
    .grid-2, .hero { grid-template-columns: 1fr; }
    .steps { grid-template-columns: 1fr 1fr; }
    .stats { grid-template-columns: 1fr 1fr; }
    .stats .stat:first-child { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
    .wrap { padding: 0 16px; }
    .page-head { flex-direction: column; }
    .form-row, .facts, .steps { grid-template-columns: 1fr; }
    .topnav-user { display: none; }
    .doc { grid-template-columns: auto minmax(0, 1fr) auto; }
    .doc-type { display: none; }
    .doc-meta { grid-column: 2 / 3; grid-row: 2; }
    .hero h1 { font-size: 1.8rem; }
}
