/* Styles partagés des pages « Directives pour les surveillants » */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --rouge: #C8002D;
    --rouge-pale: #FFF5F6;
    --encre: #1A1B1E;
    --texte: #374151;
    --doux: #6B7280;
    --bordure: #E5E7EB;
    --alerte: #B3541E;
    --alerte-fond: #FDF4EE;
    --annonce: #2E7D4F;
    --annonce-fond: #F1F8F4;
}

html { scroll-behavior: smooth; }

body {
    font-family: 'Fira Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 15px;
    background: #EDEEF0;
    color: var(--encre);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 16px 48px;
}
body::before {
    content: '';
    display: block;
    width: 100%;
    height: 5px;
    background: var(--rouge);
    flex-shrink: 0;
    margin-bottom: 28px;
}

.container {
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 1px 6px rgba(0,0,0,0.10);
    max-width: 920px;
    width: 100%;
    overflow: hidden;
}
.container.large { max-width: 1160px; }

/* ── En-tête ─────────────────────────────────── */
.page-header {
    display: flex;
    gap: 28px;
    align-items: center;
    padding: 26px 44px 24px;
    border-bottom: 1px solid #E9EAEC;
}
.page-header .logo { width: 132px; flex-shrink: 0; }
.page-header .titles { flex: 1; min-width: 0; }
.back-link {
    display: inline-block; font-size: 12px; color: #7B7F88;
    text-decoration: none; margin-bottom: 8px;
}
.back-link:hover { color: var(--rouge); }
.institution {
    font-size: 11px; font-weight: 600; text-transform: uppercase;
    letter-spacing: 0.09em; color: var(--rouge); margin-bottom: 8px;
}
h1 { font-size: 24px; font-weight: 600; color: #111; line-height: 1.2; margin-bottom: 6px; }
.subtitle { font-size: 14px; color: #7B7F88; font-weight: 300; }

/* Sélecteur de langue */
.lang-switch {
    display: inline-flex;
    border: 1.5px solid var(--bordure);
    border-radius: 999px;
    padding: 3px;
    gap: 2px;
    flex-shrink: 0;
    align-self: flex-start;
}
.lang-switch a {
    font-size: 12px; font-weight: 500; letter-spacing: 0.04em;
    padding: 5px 12px; border-radius: 999px;
    color: var(--doux); text-decoration: none;
}
.lang-switch a:hover { color: var(--rouge); }
.lang-switch a[aria-current="true"] { background: var(--rouge); color: #fff; }

/* Bascule FR / EN */
html:not(.en) [lang="en"].bloc { display: none; }
html.en [lang="fr"].bloc { display: none; }

/* ── Corps ───────────────────────────────────── */
.content { padding: 32px 44px 12px; }

.intro {
    font-size: 14.5px; color: var(--texte); line-height: 1.65;
    margin-bottom: 28px; max-width: 720px;
}

/* Sommaire des étapes */
.toc {
    display: flex; flex-wrap: wrap; gap: 8px;
    margin-bottom: 32px;
}
.toc a {
    display: inline-flex; align-items: center; gap: 7px;
    font-size: 12.5px; color: var(--texte); text-decoration: none;
    padding: 6px 12px 6px 8px;
    border: 1px solid var(--bordure); border-radius: 999px;
    background: #FAFAFB;
    transition: border-color 0.15s, color 0.15s;
}
.toc a:hover { border-color: var(--rouge); color: var(--rouge); }
.toc a span {
    display: inline-flex; align-items: center; justify-content: center;
    width: 20px; height: 20px; border-radius: 50%;
    background: var(--rouge-pale); color: var(--rouge);
    font-size: 11px; font-weight: 600;
}

/* Chronologie */
.timeline { position: relative; }
.phase {
    position: relative;
    display: grid;
    grid-template-columns: 44px 1fr;
    gap: 0 20px;
    padding-bottom: 34px;
    scroll-margin-top: 16px;
}
.phase:not(:last-child)::before {
    content: '';
    position: absolute;
    left: 21px; top: 48px; bottom: 6px;
    width: 2px;
    background: linear-gradient(var(--bordure), var(--bordure)) no-repeat;
}
.phase-icon {
    width: 44px; height: 44px; border-radius: 50%;
    background: var(--rouge-pale); color: var(--rouge);
    border: 1.5px solid #F6D3DB;
    display: flex; align-items: center; justify-content: center;
}
.phase h2 {
    font-size: 18px; font-weight: 600; color: #111;
    line-height: 44px; margin-bottom: 6px;
}
.phase-body { min-width: 0; }

ol.steps { list-style: none; counter-reset: etape; }
ol.steps > li {
    counter-increment: etape;
    position: relative;
    padding: 12px 16px 12px 52px;
    margin-bottom: 8px;
    border: 1px solid #EEF0F2;
    border-radius: 6px;
    background: #FCFCFD;
    font-size: 15px;
    line-height: 1.6;
    color: var(--texte);
}
ol.steps > li::before {
    content: counter(etape);
    position: absolute;
    left: 14px; top: 12px;
    width: 26px; height: 26px; border-radius: 50%;
    background: #fff; border: 1.5px solid #D1D5DB;
    color: #4B5563; font-size: 12.5px; font-weight: 600;
    display: flex; align-items: center; justify-content: center;
}
ol.steps strong { color: #111; font-weight: 500; }
ol.steps a, .intro a { color: var(--rouge); word-break: break-word; }

/* Encadré d'alerte */
.alerte {
    display: flex; gap: 14px; align-items: flex-start;
    margin-top: 14px;
    padding: 14px 18px;
    background: var(--alerte-fond);
    border: 1px solid #F0D2BF;
    border-left: 4px solid var(--alerte);
    border-radius: 6px;
    color: #5B2A0F;
    font-weight: 500;
    font-size: 15px;
    line-height: 1.55;
}
.alerte svg { flex-shrink: 0; color: var(--alerte); margin-top: 1px; }

/* Exemple d'annonce */
.annonce {
    margin-top: 18px;
    border: 1px solid #CDE5D6;
    border-radius: 8px;
    background: var(--annonce-fond);
    overflow: hidden;
}
.annonce-head {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 11px 18px;
    background: #E3F1E8;
    border-bottom: 1px solid #CDE5D6;
    color: #1F5A38;
    font-size: 13.5px; font-weight: 600;
}
.annonce-head .label { display: flex; align-items: center; gap: 9px; }
.annonce-body { padding: 16px 20px 6px; }
.annonce-body p {
    font-size: 15px; line-height: 1.65; color: #23302A;
    margin-bottom: 11px;
}
.champ {
    font-style: italic;
    color: var(--alerte);
    background: #FBEDE3;
    border-radius: 3px;
    padding: 0 4px;
    box-decoration-break: clone;
    -webkit-box-decoration-break: clone;
}
.copy-btn {
    display: inline-flex; align-items: center; gap: 6px;
    font-family: inherit; font-size: 12px; font-weight: 500;
    color: #1F5A38; background: #fff;
    border: 1px solid #B9DAC6; border-radius: 4px;
    padding: 4px 10px; cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}
.copy-btn:hover { border-color: var(--annonce); }

/* ── Documents sources ───────────────────────── */
.sources {
    margin: 8px 44px 36px;
    padding: 18px 22px;
    background: #F8F9FA;
    border: 1px solid #E9EAEC;
    border-radius: 6px;
    display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px;
}
.sources-label {
    font-size: 11px; font-weight: 600; text-transform: uppercase;
    letter-spacing: 0.09em; color: var(--doux);
    margin-right: auto;
}
.sources-label small {
    display: block; text-transform: none; letter-spacing: 0;
    font-weight: 400; font-size: 12.5px; margin-top: 3px; color: #9CA3AF;
}
.sources.stack .sources-label { flex-basis: 100%; margin-bottom: 2px; }
.sources.stack .group { display: flex; flex-wrap: wrap; gap: 8px; margin-right: 18px; }

.btn {
    display: inline-flex; align-items: center; gap: 7px;
    font-size: 13px; font-weight: 500;
    padding: 8px 14px; border-radius: 4px;
    text-decoration: none;
    border: 1.5px solid var(--bordure);
    color: var(--texte); background: #fff;
    transition: border-color 0.15s, color 0.15s;
}
.btn:hover { border-color: var(--rouge); color: var(--rouge); }
.btn.primary { background: var(--rouge); border-color: var(--rouge); color: #fff; }
.btn.primary:hover { background: #A80026; border-color: #A80026; color: #fff; }

/* ── Page d'accueil des directives ───────────── */
.choices {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    padding: 32px 44px 28px;
}
.choice {
    display: flex; flex-direction: column; gap: 12px;
    padding: 26px 26px 22px;
    border: 1.5px solid var(--bordure);
    border-radius: 6px;
    background: #fff;
}
.choice-top { display: flex; align-items: center; gap: 14px; }
.choice-icon {
    width: 48px; height: 48px; border-radius: 8px; flex-shrink: 0;
    background: var(--rouge-pale); color: var(--rouge);
    display: flex; align-items: center; justify-content: center;
}
.choice h2 { font-size: 18px; font-weight: 600; color: #111; line-height: 1.3; }
.choice p { font-size: 14px; color: #4B5563; line-height: 1.6; flex: 1; }
.choice ul { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; }
.choice li {
    font-size: 12px; color: var(--doux);
    padding: 3px 9px; border-radius: 999px; background: #F3F4F6;
}
.choice-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }

.share-hint {
    margin: 0 44px 28px;
    display: flex; gap: 12px; align-items: flex-start;
    font-size: 13.5px; color: var(--texte); line-height: 1.6;
}
.share-hint code {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px;
    background: #F3F4F6; border-radius: 3px; padding: 1px 5px; color: var(--rouge);
}
.share-hint svg { flex-shrink: 0; color: #9CA3AF; margin-top: 2px; }

/* ── Pied de page ────────────────────────────── */
.page-footer {
    display: flex; flex-wrap: wrap; gap: 14px 40px;
    justify-content: space-between;
    padding: 20px 44px 22px;
    background: #FAFAFB;
    border-top: 1px solid #E9EAEC;
    font-size: 13px; color: var(--doux);
    line-height: 1.6;
}
.page-footer a { color: var(--rouge); }

@media (max-width: 640px) {
    body { font-size: 14px; }
    .page-header { flex-wrap: wrap; gap: 16px; padding: 22px 20px 20px; }
    .page-header .logo { width: 104px; }
    .page-header .logo { order: -2; }
    .lang-switch { order: -1; margin-left: auto; align-self: center; }
    .page-header .titles { flex-basis: 100%; }
    h1 { font-size: 21px; }
    .content { padding: 26px 20px 8px; }
    .choices { padding: 24px 20px; }
    .share-hint { margin: 0 20px 24px; }
    .sources { margin: 4px 20px 28px; }
    .page-footer { padding-left: 20px; padding-right: 20px; }
    .phase { grid-template-columns: 36px 1fr; gap: 0 14px; }
    .phase-icon { width: 36px; height: 36px; }
    .phase-icon svg { width: 18px; height: 18px; }
    .phase:not(:last-child)::before { left: 17px; top: 40px; }
    .phase h2 { font-size: 16.5px; line-height: 36px; }
    ol.steps > li { padding: 11px 13px 11px 46px; font-size: 14.5px; }
    ol.steps > li::before { left: 11px; }
}

@media print {
    body { background: #fff; padding: 0; }
    body::before, .lang-switch, .toc, .sources, .copy-btn, .back-link, .page-footer { display: none; }
    .container { box-shadow: none; max-width: none; }
    .phase { break-inside: avoid-page; }
    ol.steps > li { break-inside: avoid; }
}
