/* ==========================================================
   Scolaria — site public (accueil, trouver mon école)
   Emplacement : assets/v1/dist/css/scolaria-site.css
   Univers : le cahier d'écolier (lignes bleues, marge rouge),
   le bulletin, l'encre bleue et le crayon jaune.
   ========================================================== */

:root {
    --st-encre: #17324d;
    --st-encre-fonce: #0f2438;
    --st-ambre: #e9a21b;
    --st-ambre-clair: #fdf1d8;
    --st-papier: #fbf9f4;
    --st-ligne-cahier: #d5e2ef;
    --st-marge: #e08a85;
    --st-texte: #1f2a37;
    --st-doux: #5b6472;
    --st-trait: #e3ddd0;
    --st-vert: #1f7a4d;
    --st-titre: 'Fraunces', Georgia, 'Times New Roman', serif;
    --st-corps: 'Nunito Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --st-pas: 34px; /* hauteur d'une ligne du cahier */
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body.st-page {
    margin: 0;
    font-family: var(--st-corps);
    font-size: 1.0625rem;
    line-height: 1.6;
    color: var(--st-texte);
    background: #fff;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--st-encre); }
a:focus-visible, button:focus-visible, summary:focus-visible, input:focus-visible {
    outline: 3px solid var(--st-ambre);
    outline-offset: 3px;
}
img { max-width: 100%; }

.st-sr {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); border: 0;
}
.st-evitement {
    position: absolute; left: 12px; top: -60px; z-index: 100;
    background: var(--st-ambre); color: var(--st-encre-fonce); padding: 8px 14px; border-radius: 8px; font-weight: 700;
}
.st-evitement:focus { top: 12px; }

.st-conteneur { width: min(1160px, 100% - 40px); margin-inline: auto; }
.st-etroit { width: min(760px, 100% - 40px); }

/* ---------- Typographie ---------- */
.st-titre-1 {
    font-family: var(--st-titre);
    font-weight: 600;
    font-size: clamp(2.1rem, 1.3rem + 3.2vw, 3.6rem);
    line-height: 1.08;
    letter-spacing: -.015em;
    color: var(--st-encre);
    margin: 0 0 22px;
    max-width: 17ch;
}
.st-titre-2 {
    font-family: var(--st-titre);
    font-weight: 600;
    font-size: clamp(1.65rem, 1.2rem + 1.6vw, 2.4rem);
    line-height: 1.15;
    color: var(--st-encre);
    margin: 0 0 12px;
}
.st-chapeau { font-size: 1.15rem; color: var(--st-doux); max-width: 56ch; margin: 0 0 28px; }
.st-intro { color: var(--st-doux); max-width: 62ch; margin: 0 0 36px; }

/* ---------- Boutons ---------- */
.st-bouton {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 10px 18px; border-radius: 10px; border: 2px solid transparent;
    font-weight: 800; font-size: .98rem; text-decoration: none; cursor: pointer; line-height: 1.2;
}
.st-bouton-grand { padding: 14px 24px; font-size: 1.04rem; }
.st-bouton-ambre { background: var(--st-ambre); color: var(--st-encre-fonce); }
.st-bouton-ambre:hover { background: #d8920f; color: var(--st-encre-fonce); }
.st-bouton-encre { background: var(--st-encre); color: #fff; }
.st-bouton-encre:hover { background: var(--st-encre-fonce); color: #fff; }
.st-bouton-trait { background: transparent; color: var(--st-encre); border-color: var(--st-encre); }
.st-bouton-trait:hover { background: var(--st-encre); color: #fff; }
.st-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 18px; }

/* ---------- En-tête ---------- */
.st-entete {
    position: sticky; top: 0; z-index: 50;
    background: rgba(255, 255, 255, .96);
    border-bottom: 1px solid var(--st-trait);
    backdrop-filter: saturate(1.4) blur(6px);
}
.st-entete-ligne { display: flex; align-items: center; gap: 20px; min-height: 68px; }
.st-marque { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--st-encre); }
.st-marque-logo {
    width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center;
    background: var(--st-ambre); color: var(--st-encre-fonce); font-size: 1.05rem;
}
.st-marque-nom { font-family: var(--st-titre); font-weight: 700; font-size: 1.45rem; }
.st-marque-claire { color: #fff; }

.st-nav { margin-left: auto; display: flex; align-items: center; gap: 22px; }
.st-nav a:not(.st-bouton) { text-decoration: none; font-weight: 700; color: var(--st-texte); font-size: .97rem; }
.st-nav a:not(.st-bouton):hover { color: var(--st-encre); text-decoration: underline; text-underline-offset: 4px; }
.st-nav-connexion { padding-left: 22px; border-left: 1px solid var(--st-trait); }
.st-menu-bouton {
    display: none; margin-left: auto; width: 44px; height: 44px; border-radius: 10px;
    border: 1px solid var(--st-trait); background: #fff; color: var(--st-encre); font-size: 1.1rem; cursor: pointer;
}

/* ---------- Ouverture : la page de cahier ---------- */
.st-ouverture {
    position: relative;
    padding: 64px 0 80px;
    background-color: var(--st-papier);
    background-image: repeating-linear-gradient(to bottom, transparent 0, transparent calc(var(--st-pas) - 1px),
            var(--st-ligne-cahier) calc(var(--st-pas) - 1px), var(--st-ligne-cahier) var(--st-pas));
    border-bottom: 1px solid var(--st-trait);
    overflow: hidden;
}
/* la marge rouge du cahier */
.st-ouverture::before {
    content: ""; position: absolute; top: 0; bottom: 0;
    left: max(12px, calc((100% - 1160px) / 2 - 28px));
    width: 2px; background: var(--st-marge); opacity: .75;
}
.st-ouverture-grille { display: grid; grid-template-columns: 1.1fr .9fr; gap: 56px; align-items: center; position: relative; }
.st-note-offre { margin: 0; font-weight: 700; color: var(--st-encre); }
.st-note-offre i { color: var(--st-ambre); margin-right: 4px; }

/* ---------- Le bulletin (élément central de la page) ---------- */
.st-bulletin {
    margin: 0;
    background: #fff;
    border: 1px solid #d9d2c3;
    border-radius: 6px;
    padding: 22px 24px 18px;
    box-shadow: 0 1px 0 #ece6d9, 0 18px 40px -18px rgba(23, 50, 77, .35);
    transform: rotate(1.2deg);
    font-size: .95rem;
}
.st-bulletin-tete {
    display: flex; justify-content: space-between; align-items: flex-start; gap: 12px;
    border-bottom: 2px solid var(--st-encre); padding-bottom: 10px;
}
.st-bulletin-tete strong { display: block; font-family: var(--st-titre); font-size: 1.15rem; color: var(--st-encre); }
.st-bulletin-tete span { color: var(--st-doux); font-size: .88rem; }
.st-bulletin-annee { font-weight: 700; color: var(--st-encre) !important; }
.st-bulletin-eleve { margin: 10px 0 6px; font-weight: 700; }
.st-bulletin-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.st-bulletin-table th, .st-bulletin-table td { padding: 6px 4px; border-bottom: 1px solid #eee7da; text-align: right; }
.st-bulletin-table th:first-child, .st-bulletin-table td:first-child { text-align: left; }
.st-bulletin-table thead th { font-size: .78rem; color: var(--st-doux); font-weight: 700; }
.st-bulletin-table tfoot th, .st-bulletin-table tfoot td { font-weight: 800; border-bottom: 0; border-top: 2px solid var(--st-encre); }
.st-note { display: inline-block; min-width: 2.2ch; color: #1b4f8a; font-weight: 700; }
.st-bulletin-resultat {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
    margin-top: 12px; padding: 10px 12px; background: var(--st-ambre-clair); border-radius: 6px;
}
.st-bulletin-resultat span { display: block; font-size: .76rem; color: #7a5a14; }
.st-bulletin-resultat strong { font-size: 1.02rem; color: var(--st-encre); }
.st-bulletin-legende { margin-top: 10px; font-size: .82rem; color: var(--st-doux); }

/* Animation unique : les points s'écrivent, puis le résultat apparaît */
.st-bulletin.st-anime tbody tr, .st-bulletin.st-anime tfoot tr { opacity: .35; transition: opacity .25s ease; }
.st-bulletin.st-anime tr.st-ecrit { opacity: 1; }
.st-bulletin.st-anime [data-final] { opacity: 0; transform: translateY(4px); transition: opacity .35s ease, transform .35s ease; }
.st-bulletin.st-anime [data-final].st-visible { opacity: 1; transform: none; }

/* ---------- Sections ---------- */
.st-section { padding: 88px 0; }
.st-section-encre { background: var(--st-encre); color: #e8eef5; }
.st-section-encre .st-titre-2 { color: #fff; }
.st-section-encre .st-intro { color: #b9c7d6; }
.st-section-papier { background: var(--st-papier); border-block: 1px solid var(--st-trait); }
.st-section-cahier { background: var(--st-papier); min-height: 60vh; }

/* Le registre : trois colonnes comme un cahier de suivi */
.st-registre { border-top: 2px solid var(--st-encre); }
.st-registre-ligne {
    display: grid; grid-template-columns: 1fr 1fr 1.4fr; gap: 28px;
    padding: 20px 0; border-bottom: 1px solid var(--st-trait);
}
.st-registre-entete { padding: 10px 0; font-size: .85rem; font-weight: 800; color: var(--st-doux); }
.st-registre-ligne strong { font-family: var(--st-titre); font-weight: 600; font-size: 1.12rem; color: var(--st-encre); line-height: 1.3; }
.st-avant { color: #8a6f6c; text-decoration: line-through; text-decoration-color: rgba(224, 138, 133, .7); text-decoration-thickness: 1.5px; }
.st-apres { color: var(--st-texte); }

/* Par rôle */
.st-roles { display: grid; grid-template-columns: repeat(4, 1fr); }
.st-roles > div { padding: 4px 24px 4px 0; }
.st-roles > div + div { padding-left: 24px; border-left: 1px solid rgba(255, 255, 255, .16); }
.st-roles h3 { font-size: 1.05rem; font-weight: 800; color: #fff; margin: 0 0 14px; }
.st-roles h3 i { color: var(--st-ambre); margin-right: 6px; }
.st-roles ul { list-style: none; margin: 0; padding: 0; }
.st-roles li { padding: 7px 0; border-bottom: 1px dashed rgba(255, 255, 255, .14); }

/* Étapes : vraie suite numérotée */
.st-etapes { list-style: none; counter-reset: etape; margin: 28px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; }
.st-etapes li { counter-increment: etape; position: relative; padding-top: 64px; }
.st-etapes li::before {
    content: counter(etape); position: absolute; top: 0; left: 0;
    font-family: var(--st-titre); font-weight: 700; font-size: 2.6rem; line-height: 1; color: var(--st-ambre);
}
.st-etapes li::after {
    content: ""; position: absolute; top: 22px; left: 44px; right: -20px; height: 2px;
    background: repeating-linear-gradient(to right, var(--st-trait) 0 8px, transparent 8px 14px);
}
.st-etapes li:last-child::after { display: none; }
.st-etapes h3 { font-size: 1.2rem; font-weight: 800; color: var(--st-encre); margin: 0 0 8px; }
.st-etapes p { margin: 0; color: var(--st-doux); }
.st-remarque { margin: 40px 0 0; padding: 14px 18px; background: var(--st-ambre-clair); border-radius: 10px; color: #6b4d0f; }
.st-remarque i { margin-right: 6px; }
.st-remarque a { color: #6b4d0f; font-weight: 800; }

/* Manuel d'utilisation (section Démarrer) */
.st-manuel { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; margin: 18px 0 0; padding: 16px 18px;
    border: 1px solid var(--st-trait); border-radius: 10px; background: #fff; }
.st-manuel > i { font-size: 1.6rem; color: #b8322a; }
.st-manuel > span { flex: 1 1 280px; color: var(--st-texte); }
.st-manuel-lien { color: var(--st-encre); font-weight: 800; text-decoration: underline; text-underline-offset: 3px; }
.st-manuel-lien:hover { color: var(--st-encre-fonce); }

/* Tarif */
.st-tarif { display: grid; grid-template-columns: 1.3fr 1fr; gap: 56px; align-items: center; }
.st-inclus { list-style: none; margin: 0; padding: 24px 28px; background: #fff; border: 1px solid var(--st-trait); border-radius: 12px; }
.st-inclus li { padding: 9px 0; font-weight: 700; }
.st-inclus li + li { border-top: 1px solid #f0ebe0; }
.st-inclus i { color: var(--st-vert); margin-right: 10px; }

/* Questions */
.st-questions details { border-bottom: 1px solid var(--st-trait); }
.st-questions summary {
    list-style: none; cursor: pointer; padding: 20px 36px 20px 0; position: relative;
    font-weight: 800; font-size: 1.08rem; color: var(--st-encre);
}
.st-questions summary::-webkit-details-marker { display: none; }
.st-questions summary::after {
    content: "+"; position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
    font-size: 1.5rem; font-weight: 400; color: var(--st-ambre);
}
.st-questions details[open] summary::after { content: "−"; }
.st-questions p { margin: -6px 0 22px; color: var(--st-doux); max-width: 64ch; }

/* Dernier appel */
.st-final { background: var(--st-ambre); padding: 56px 0; }
.st-final-ligne { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 24px; }
.st-final .st-titre-2 { color: var(--st-encre-fonce); }
.st-final p { margin: 0; color: #4a3507; font-weight: 700; }
.st-final .st-bouton-ambre { background: var(--st-encre); color: #fff; }
.st-final .st-bouton-ambre:hover { background: var(--st-encre-fonce); }

/* Trouver mon école */
.st-recherche { display: flex; gap: 10px; margin-bottom: 24px; }
.st-recherche input {
    flex: 1; min-width: 0; padding: 14px 16px; font: inherit; border: 2px solid var(--st-trait);
    border-radius: 10px; background: #fff;
}
.st-recherche input:focus { border-color: var(--st-encre); }
.st-resultats { list-style: none; margin: 0; padding: 0; background: #fff; border: 1px solid var(--st-trait); border-radius: 12px; }
.st-resultats li + li { border-top: 1px solid var(--st-trait); }
.st-resultats a { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 16px 18px; text-decoration: none; color: var(--st-texte); }
.st-resultats a:hover { background: var(--st-ambre-clair); }
.st-resultats small { display: block; color: var(--st-doux); }
.st-resultat-action { font-weight: 800; color: var(--st-encre); white-space: nowrap; }
.st-vide { padding: 16px 18px; background: #fff; border: 1px dashed var(--st-trait); border-radius: 12px; color: var(--st-doux); }

/* Pied de page */
.st-pied { background: var(--st-encre-fonce); color: #b9c7d6; padding: 56px 0 24px; font-size: .95rem; }
.st-pied-grille { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 40px; }
.st-pied-texte { margin: 14px 0 0; max-width: 40ch; }
.st-pied-titre { color: #fff; font-weight: 800; margin: 0 0 12px; }
.st-pied-liste { list-style: none; margin: 0; padding: 0; }
.st-pied-liste li { padding: 4px 0; }
.st-pied-liste a { color: #dbe4ee; text-decoration: none; }
.st-pied-liste a:hover { color: #fff; text-decoration: underline; }
.st-pied-liste i { width: 20px; color: var(--st-ambre); }
.st-pied-bas {
    display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px;
    margin-top: 40px; padding-top: 18px; border-top: 1px solid rgba(255, 255, 255, .12); font-size: .85rem;
}

/* ---------- Tablette et téléphone ---------- */
@media (max-width: 980px) {
    .st-ouverture-grille, .st-tarif { grid-template-columns: 1fr; gap: 40px; }
    .st-bulletin { transform: none; max-width: 520px; }
    .st-roles { grid-template-columns: 1fr 1fr; row-gap: 32px; }
    .st-roles > div:nth-child(3) { padding-left: 0; border-left: 0; }
    .st-pied-grille { grid-template-columns: 1fr 1fr; }
    .st-pied-grille > div:first-child { grid-column: 1 / -1; }
}

@media (max-width: 860px) {
    .st-menu-bouton { display: inline-grid; place-items: center; }
    .st-nav {
        display: none; position: absolute; top: 68px; left: 0; right: 0;
        flex-direction: column; align-items: stretch; gap: 0;
        background: #fff; border-bottom: 1px solid var(--st-trait); padding: 8px 20px 18px;
    }
    .st-nav.ouvert { display: flex; }
    .st-nav a:not(.st-bouton) { padding: 12px 0; border-bottom: 1px solid #f0ebe0; }
    .st-nav-connexion { padding-left: 0 !important; border-left: 0 !important; }
    .st-nav .st-bouton { margin-top: 14px; }
}

@media (max-width: 720px) {
    .st-section { padding: 64px 0; }
    .st-ouverture { padding: 40px 0 56px; }
    .st-ouverture::before { left: 10px; }
    .st-registre-entete { display: none; }
    .st-registre-ligne { grid-template-columns: 1fr; gap: 6px; }
    .st-avant::before { content: "Aujourd'hui : "; text-decoration: none; display: inline; }
    .st-etapes { grid-template-columns: 1fr; gap: 28px; }
    .st-etapes li { padding: 0 0 0 56px; }
    .st-etapes li::before { font-size: 2.2rem; }
    .st-etapes li::after { display: none; }
    .st-roles { grid-template-columns: 1fr; }
    .st-roles > div, .st-roles > div + div { padding: 0; border-left: 0; }
    .st-bulletin { padding: 18px 16px 14px; }
    .st-bulletin-resultat strong { font-size: .95rem; }
    .st-recherche { flex-direction: column; }
    .st-pied-grille { grid-template-columns: 1fr; }
}

/* Choix de la langue dans le menu (FR · EN · SW) */
.st-nav-langues { display: inline-flex; align-items: center; gap: 8px; font-size: .85rem; color: var(--st-texte); }
.st-nav-langues .fa-globe { opacity: .55; }
.st-nav-langues strong { color: var(--st-encre); }
.st-nav .st-nav-langues a:not(.st-bouton) { font-weight: 600; font-size: .85rem; opacity: .8; }

@media (max-width: 860px) {
    .st-nav-langues { padding: 12px 0; border-bottom: 1px solid #f0ebe0; gap: 14px; }
    .st-nav .st-nav-langues a:not(.st-bouton) { padding: 0; border-bottom: 0; }
}
