/* Base commune aux deux vitrines : reset, typographie, mise en page, composants.
   Les couleurs propres à chaque vitrine sont dans assets/<vitrine>/site.css. */

:root {
    --ink: #17202b;
    --ink-soft: #4a5565;
    --line: #dfe3e8;
    --bg: #ffffff;
    --bg-soft: #f5f7f9;
    --accent: #1d5fd1;
    --accent-ink: #ffffff;
    --accent-soft: #e8f0fc;
    --ok: #1f7a4d;
    --warn: #b45309;
    --radius: 10px;
    --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 4px 16px rgba(16, 24, 40, .06);
    --container: 1120px;
    --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 400 1rem/1.6 var(--font); color: var(--ink); background: var(--bg); }
/* Pied de page collé en bas de la fenêtre quand la page est courte */
body { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
body > main { flex: 1 0 auto; }
body > .site-header, body > .site-footer { flex-shrink: 0; }
img, svg { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-underline-offset: .15em; }
a:hover { text-decoration-thickness: 2px; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(1.8rem, 1.2rem + 2.6vw, 2.8rem); font-weight: 750; }
h2 { font-size: clamp(1.35rem, 1.1rem + 1vw, 1.8rem); font-weight: 700; }
h3 { font-size: 1.15rem; font-weight: 650; }
p { margin: 0 0 1em; }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.skip-link { position: absolute; left: -9999px; top: 0; padding: .6rem 1rem; background: var(--ink); color: #fff; z-index: 10; }
.skip-link:focus { left: 1rem; top: 1rem; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .container { padding: 0 24px; } }

/* En-tête */
.site-header { border-bottom: 1px solid var(--line); background: var(--bg); position: sticky; top: 0; z-index: 5; }
.site-header .container { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 64px; }
.brand { display: flex; align-items: center; gap: .6rem; color: var(--ink); text-decoration: none; font-weight: 750; font-size: 1.1rem; }
.brand svg { width: 28px; height: 28px; }
.nav { display: flex; gap: 1.25rem; align-items: center; font-size: .95rem; }
.nav a { color: var(--ink-soft); text-decoration: none; }
.nav a:hover { color: var(--ink); }
.nav a.btn-primary, .nav a.btn-primary:hover { color: var(--accent-ink); }
@media (max-width: 719px) { .nav .nav-secondary { display: none; } }

/* Boutons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-height: 44px; padding: .65rem 1.2rem;
       border: 1px solid transparent; border-radius: var(--radius); font: 600 1rem/1.2 var(--font); text-decoration: none; cursor: pointer; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { filter: brightness(.94); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }

/* Bandeau d'accroche */
.hero { padding: clamp(2.5rem, 6vw, 5rem) 0 clamp(2rem, 5vw, 4rem); background: var(--bg-soft); border-bottom: 1px solid var(--line); }
.hero .lead { font-size: clamp(1.05rem, 1rem + .4vw, 1.25rem); color: var(--ink-soft); max-width: 46rem; }
.eyebrow { display: inline-block; font-size: .8rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); margin-bottom: .75rem; }

/* Sections et cartes */
.section { padding: clamp(2.5rem, 6vw, 4.5rem) 0; }
.grid { display: grid; gap: 1.25rem; }
@media (min-width: 720px) { .grid-3 { grid-template-columns: repeat(3, 1fr); } .grid-2 { grid-template-columns: repeat(2, 1fr); } }
.card { background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.4rem; box-shadow: var(--shadow); }
.card h3 { margin-bottom: .35rem; }
.card p { color: var(--ink-soft); margin: 0; }

/* Formulaires */
.field { display: grid; gap: .35rem; }
.field label { font-weight: 600; font-size: .95rem; }
.input { width: 100%; min-height: 48px; padding: .7rem .9rem; border: 1px solid #c4cbd4; border-radius: var(--radius); font: inherit; background: #fff; }
.input:focus { border-color: var(--accent); outline: 3px solid var(--accent-soft); }

.notice { padding: .9rem 1.1rem; border-radius: var(--radius); background: var(--accent-soft); color: var(--ink); font-size: .95rem; }

/* Pied de page */
.site-footer { border-top: 1px solid var(--line); background: var(--bg-soft); padding: 2.5rem 0; font-size: .9rem; color: var(--ink-soft); }
.site-footer .container { display: grid; gap: 1rem; }
.site-footer a { color: var(--ink-soft); }
.cross-link { font-weight: 600; }
.source-note { font-size: .82rem; }

.muted { color: var(--ink-soft); }

/* Messages */
.alert { padding: .85rem 1rem; border-radius: var(--radius); margin: 0 0 1rem; font-size: .95rem; border: 1px solid transparent; }
.alert-success { background: #e3f4ea; border-color: #b9e2c8; color: #14532d; }
.alert-error { background: #fde4e4; border-color: #f5c2c0; color: #7f1d1d; }
.alert-info { background: var(--accent-soft); color: var(--ink); }

/* Pages de compte */
.auth-wrap { padding: clamp(2rem, 6vw, 4rem) 0; background: var(--bg-soft); min-height: 60vh; }
.auth-card { max-width: 460px; margin: 0 auto; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: clamp(1.25rem, 4vw, 2rem); box-shadow: var(--shadow); }
.auth-card.wide { max-width: 640px; }
.auth-card h1 { font-size: 1.6rem; }
.form-stack { display: grid; gap: 1rem; }
.form-row { display: grid; gap: 1rem; }
@media (min-width: 560px) { .form-row { grid-template-columns: 1fr 1fr; } }
.field-error { color: #b42318; font-size: .85rem; }
.hint { color: var(--ink-soft); font-size: .85rem; }
.check { display: flex; gap: .6rem; align-items: flex-start; font-size: .92rem; }
.check input { margin-top: .3rem; width: 18px; height: 18px; }
.btn-block { width: 100%; }
.divider { display: flex; align-items: center; gap: .75rem; color: var(--ink-soft); font-size: .85rem; margin: 1.25rem 0; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.link-row { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; font-size: .92rem; }
select.input { appearance: auto; }
textarea.input { min-height: 8rem; resize: vertical; line-height: 1.5; }

/* Autocomplétion d'adresse */
.ac-list { position: absolute; z-index: 20; left: 0; right: 0; top: 100%; margin: 4px 0 0; padding: 4px; list-style: none; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); max-height: 280px; overflow-y: auto; }
.ac-list li { padding: .55rem .7rem; border-radius: 6px; cursor: pointer; font-size: .95rem; }
.ac-list li:hover, .ac-list li.active { background: var(--accent-soft); }

/* Espace entreprise */
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.page-head h1 { margin: 0; }
.crumbs { font-size: .9rem; margin-bottom: .5rem; }
.kpi-row { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin: 1rem 0 1.5rem; }
.kpi-box { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: .9rem 1rem; }
.kpi-box b { display: block; font-size: 1.6rem; line-height: 1.2; }
.kpi-box span { color: var(--ink-soft); font-size: .85rem; }
.kpi-box.accent { border-color: var(--accent); }
.kpi-box.accent b { color: var(--accent); }
.fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem; margin: 0; }
.fieldset legend { font-weight: 650; padding: 0 .4rem; }
.warning { background: #fdf0dc; border: 1px solid #f3d9a8; color: #6b3d06; padding: .85rem 1rem; border-radius: var(--radius); font-size: .93rem; }

/* Calendrier mensuel */
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal .dow { text-align: center; font-size: .78rem; color: var(--ink-soft); font-weight: 600; padding: .2rem 0; }
.cal .day { min-height: 64px; border-radius: 8px; padding: .35rem .45rem; font-size: .8rem; border: 1px solid var(--line); background: #fff; position: relative; text-decoration: none; color: inherit; }
.cal .day .n { font-weight: 700; font-size: .9rem; }
.cal .day .tag { display: block; margin-top: .2rem; line-height: 1.2; }
.cal .day.empty { border: 0; background: transparent; }
.cal .day.intemperie { background: #fde4e4; border-color: #f2b8b5; }
.cal .day.normal { background: #eef8f2; border-color: #cfe9da; }
.cal .day.insufficient { background: #fdf3e1; border-color: #f2d9a6; }
.cal .day.non_worked { background: #f2f3f5; color: var(--ink-soft); }
.cal .day.added { box-shadow: inset 0 0 0 2px #e11d48; }
.cal .day.future { background: #fff; color: #9aa3ae; }
.cal .day.today { outline: 2px solid var(--accent); outline-offset: 1px; }
@media (max-width: 560px) { .cal .day { min-height: 46px; padding: .25rem; } .cal .day .tag { display: none; } }
.legend { display: flex; gap: .9rem; flex-wrap: wrap; font-size: .82rem; color: var(--ink-soft); margin-top: .6rem; }
.legend i { display: inline-block; width: .8rem; height: .8rem; border-radius: 3px; margin-right: .3rem; vertical-align: -1px; border: 1px solid var(--line); }

/* Pages légales */
.legal { max-width: 46rem; }
.legal h1 { margin-bottom: .25rem; }
.legal h2 { font-size: 1.2rem; margin-top: 2rem; }
.legal p, .legal li { color: var(--ink); }
.legal ul { padding-left: 1.2rem; }
.legal li { margin-bottom: .4rem; }
.legal-updated { color: var(--ink-soft); font-size: .9rem; }
.legal-nav { margin-top: 2.5rem; padding-top: 1rem; border-top: 1px solid var(--line); font-size: .92rem; }

/* Champs côte à côte : alignés en haut, jamais étirés par la hauteur de la colonne voisine */
.form-row { align-items: start; }
.field { align-content: start; }

/* Interrupteur on / off (case à cocher accessible, stylée) */
.switch { display: inline-flex; align-items: center; gap: .55rem; cursor: pointer; font-size: .9rem; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .track { position: relative; width: 42px; height: 24px; border-radius: 999px; background: #c4cbd4; transition: background .15s; flex: none; }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform .15s; }
.switch input:checked + .track { background: var(--accent); }
.switch input:checked + .track::after { transform: translateX(18px); }
.switch input:focus-visible + .track { outline: 3px solid var(--accent); outline-offset: 2px; }
.switch .on { display: none; } .switch .off { display: inline; color: var(--ink-soft); }
.switch input:checked ~ .on { display: inline; } .switch input:checked ~ .off { display: none; }
.criterion { border: 1px solid var(--line); border-radius: var(--radius); padding: .85rem 1rem; transition: opacity .15s, background .15s; }
.criterion:has(.switch input:not(:checked)) { opacity: .55; background: var(--bg-soft); }

/* Tableaux de contenu (guides, pages communes et épisodes) */
.table-wrap { overflow-x: auto; margin: 1rem 0 1.25rem; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th, .table td { padding: .55rem .75rem; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th { background: var(--bg-soft); font-weight: 650; white-space: nowrap; }
.table tr:last-child td { border-bottom: 0; }
.table td.num, .table th.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.guide-list { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.guide-list .card h2 { font-size: 1.1rem; margin: 0 0 .4rem; }
.guide-list .card p { margin: 0; color: var(--ink-soft); }
.footer-links { font-size: .88rem; line-height: 1.7; }
