/* =============================================================================
   Wawa — feuille de style du site du serveur
   Charte « Aube » (voir CHARTE_GRAPHIQUE_WAWA.md à la racine du projet) : la nuit (prune)
   qui s'ouvre sur le lever du jour (aurore, soleil), sur un fond crème.
   Aucune dépendance externe : polices système (sérif pour les titres et les heures,
   sans-sérif pour le reste), icônes SVG inline, aucune animation continue.
   ============================================================================= */

:root {
    /* ciel (bleu ardoise et nuit apaisante, réduisant la lumière bleue vive pour le réveil) */
    --nuit: #101722;
    --prune-700: #1d2a3d;
    --prune-600: #2b5573;
    --prune-500: #3f7296;
    --lavande-300: #8fc5e8;
    --prune-100: #e4eff7;
    --prune-50: #f0f6fa;
    /* horizon (ambre doré chaleureux, non agressif au réveil) */
    --aurore-600: #b26425;
    --aurore-500: #d9822b;
    --aurore-300: #e8a96e;
    --aurore-100: #fcecdd;
    /* soleil (or matinal doux et feutré) */
    --soleil-500: #f2b451;
    --soleil-300: #f9d68a;
    --soleil-100: #fef5e3;
    --soleil-800: #744707;

    /* Rôles : ambiance nuit feutrée par défaut (application de réveil et de chevet) */
    --principal: var(--lavande-300);
    --principal-survol: #b3daf5;
    --sur-principal: var(--nuit);
    --accent-texte: var(--aurore-300);
    --fond: #0d131c;
    --surface: #141c27;
    --surface-2: #1c2634;
    --ligne: #2a384a;
    --encre: #edf2f7;
    --encre-douce: #9db0c3;
    --succes: #9fe3b5;
    --succes-fond: #163a24;
    --erreur: #e8a96e;
    --erreur-fond: #3d2411;
    --badge-prive-fond: #1c2634;
    --badge-prive-texte: var(--lavande-300);
    --badge-public-fond: #3b2807;
    --badge-public-texte: var(--soleil-300);
    --focus: #2a384a;

    --rayon: 20px;
    --rayon-petit: 12px;
    --ombre: 0 1px 2px rgba(0, 0, 0, .4), 0 16px 40px -20px rgba(0, 0, 0, .7);
    --police: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --police-titre: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino, "URW Palladio L", Georgia, serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { font-size: 16px; }

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: var(--police);
    color: var(--encre);
    background: var(--fond);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--principal); text-underline-offset: 3px; }

h1, h2, .titre {
    font-family: var(--police-titre);
    font-weight: 500;
    letter-spacing: -.02em;
    line-height: 1.1;
}

:focus-visible { outline: 3px solid var(--principal); outline-offset: 2px; }

/* ----------------------------------------------------------------- en-tête */
.entete {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 24px;
    max-width: 1080px;
    width: 100%;
    margin: 0 auto;
}

.marque {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--encre);
    font-family: var(--police-titre);
    font-weight: 600;
    font-size: 1.35rem;
    letter-spacing: -.02em;
}

.marque__logo { width: 34px; height: 34px; display: block; border-radius: 9px; }

.nav { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px 12px; }
.nav form { margin: 0; }
.nav__pseudo { color: var(--encre-douce); font-weight: 600; }

/* ----------------------------------------------------------------- boutons */
.bouton {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 22px;
    border-radius: 999px;
    border: 1px solid transparent;
    font: inherit;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: transform .12s ease, background-color .12s ease, border-color .12s ease;
}

.bouton:active { transform: translateY(1px); }

.bouton--principal {
    background: var(--principal);
    color: var(--sur-principal);
}
.bouton--principal:hover { background: var(--principal-survol); }

/* Accent : corail avec texte nuit (jamais blanc sur corail : contraste insuffisant). */
.bouton--accent {
    background: var(--aurore-500);
    color: var(--nuit);
}
.bouton--accent:hover { background: var(--aurore-300); }

.bouton--discret {
    background: transparent;
    color: var(--encre);
    border-color: var(--ligne);
}
.bouton--discret:hover { background: var(--surface-2); border-color: var(--principal); }

.bouton--large { width: 100%; min-height: 52px; font-size: 1.05rem; }

/* ----------------------------------------------------------------- messages */
.messages {
    max-width: 1080px;
    width: 100%;
    margin: 0 auto;
    padding: 0 24px;
    display: grid;
    gap: 8px;
}

.message {
    padding: 12px 16px;
    border-radius: var(--rayon-petit);
    font-weight: 500;
    background: var(--surface-2);
    color: var(--encre);
    border-left: 4px solid var(--principal);
}
.message--success { background: var(--succes-fond); color: var(--succes); border-left-color: var(--succes); }
.message--error { background: var(--erreur-fond); color: var(--erreur); border-left-color: var(--aurore-500); }

/* ----------------------------------------------------------------- contenu */
.contenu {
    flex: 1;
    width: 100%;
    max-width: 1080px;
    margin: 0 auto;
    padding: 16px 24px 48px;
}

.pied {
    padding: 24px;
    text-align: center;
    color: var(--encre-douce);
    font-size: .9rem;
    font-family: var(--police-titre);
    font-style: italic;
}

/* ----------------------------------------------------------------- le ciel (panneau nuit) */
/* Fond commun de la carte « nuit » : ciel dégradé, soleil dans l'angle, horizon corail. */
.ciel {
    position: relative;
    overflow: hidden;
    border-radius: var(--rayon);
    color: #fff;
    background: linear-gradient(180deg, var(--nuit) 0%, var(--prune-700) 100%);
}

/* le soleil : son centre est posé sur l'horizon, la moitié basse disparaît derrière la terre */
.ciel::before {
    content: "";
    position: absolute;
    right: 8%;
    bottom: 18%;
    width: 38%;
    max-width: 260px;
    aspect-ratio: 1;
    border-radius: 50%;
    background: radial-gradient(circle at 45% 35%, var(--soleil-300), var(--soleil-500) 55%, var(--aurore-500) 100%);
    box-shadow: 0 0 80px 24px rgba(246, 168, 58, .28);
    transform: translateY(50%);
    animation: lever .9s cubic-bezier(.2, .7, .2, 1) both;
}

/* la terre et la ligne d'horizon */
.ciel::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 18%;
    background: var(--prune-700);
    border-top: 2px solid var(--aurore-500);
}

.ciel > * { position: relative; z-index: 1; }

@keyframes lever {
    from { transform: translateY(72%); opacity: .5; }
    to { transform: translateY(50%); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
    .ciel::before { animation: none; }
    .bouton, .champ input { transition: none; }
}

/* ----------------------------------------------------------------- pages d'authentification */
.auth {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 32px;
    align-items: stretch;
    margin-top: 16px;
}

.auth__panneau {
    padding: 40px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    min-height: 440px;
}

.auth__sur-titre {
    text-transform: uppercase;
    letter-spacing: .14em;
    font-size: .75rem;
    font-weight: 700;
    color: var(--soleil-300);
    margin: 0 0 10px;
}

.auth__titre {
    font-size: clamp(1.9rem, 3.2vw, 2.6rem);
    margin: 0 0 12px;
    max-width: 16ch;
}

.auth__texte { margin: 0; color: rgba(255, 255, 255, .82); max-width: 34ch; }

.auth__points {
    list-style: none;
    padding: 0;
    margin: 20px 0 0;
    display: grid;
    gap: 8px;
    color: rgba(255, 255, 255, .9);
    font-size: .95rem;
    max-width: 36ch;
}
.auth__points li::before { content: "— "; color: var(--aurore-300); }

.carte {
    background: var(--surface);
    border: 1px solid var(--ligne);
    border-radius: var(--rayon);
    box-shadow: var(--ombre);
    padding: 36px;
}

.carte__titre { margin: 0 0 4px; font-size: 1.7rem; }
.carte__sous-titre { margin: 0 0 24px; color: var(--encre-douce); }

.carte__pied {
    margin: 20px 0 0;
    text-align: center;
    color: var(--encre-douce);
    font-size: .95rem;
}

@media (max-width: 820px) {
    .auth { grid-template-columns: 1fr; }
    /* Le texte reste au-dessus du soleil et de l'horizon : marge basse réservée, soleil plus petit. */
    .auth__panneau { min-height: 280px; padding: 28px 28px 150px; }
    .ciel::before { width: 32%; right: 6%; }
    .carte { padding: 24px; }
}

/* Inscription et connexion : un seul balayage vers le bas passe de la présentation au formulaire
   (bascule faite par ecrans_auth.js).
   Écran 1 = en-tête + présentation + titre du formulaire (rien n'est coupé) ; écran 2 = le formulaire. */
.auth__ecran { display: contents; }
.auth__suite { display: none; }

@media (max-width: 820px) {
    .auth--ecrans { margin-top: 0; gap: 0; }
    .auth--ecrans .auth__ecran {
        display: flex; flex-direction: column; gap: 14px;
        min-height: calc(100svh - 76px);
    }
    .auth--ecrans .auth__panneau { flex: 1; }
    .auth--ecrans .auth__suite {
        display: flex; flex-direction: column; align-items: center; gap: 2px;
        padding: 4px 0 20px; color: var(--encre); text-decoration: none;
        font-family: var(--police-titre); font-size: 1.25rem;
    }
    .auth--ecrans .auth__suite::after { content: "⌄"; color: var(--principal); font-size: 1.6rem; line-height: .6; }
    .auth--ecrans .carte { min-height: 100svh; }
}

/* Petits écrans (iPhone) : l'en-tête tient sur une ligne, boutons compacts, sans chevauchement. */
@media (max-width: 480px) {
    .entete { padding: 12px 16px; gap: 8px; flex-wrap: wrap; }
    .marque { flex: 0 0 auto; }
    .nav { flex: 1 1 auto; flex-wrap: nowrap; gap: 6px; }
    .nav .bouton { min-height: 40px; padding: 0 14px; font-size: .9rem; white-space: nowrap; }
    .contenu { padding-left: 16px; padding-right: 16px; }
}

/* ----------------------------------------------------------------- formulaires */
.formulaire { display: grid; gap: 18px; }

.champ label {
    display: block;
    font-weight: 600;
    font-size: .9rem;
    margin-bottom: 6px;
}

.champ input {
    width: 100%;
    min-height: 48px;
    padding: 0 14px;
    border-radius: var(--rayon-petit);
    border: 1px solid var(--ligne);
    background: var(--fond);
    color: var(--encre);
    font: inherit;
    transition: border-color .12s ease, box-shadow .12s ease;
}

.champ input:focus {
    outline: none;
    border-color: var(--principal);
    box-shadow: 0 0 0 4px var(--focus);
    background: var(--surface);
}

.champ--erreur input { border-color: var(--aurore-500); }

.champ .aide { margin: 6px 0 0; font-size: .85rem; color: var(--encre-douce); }

.errorlist {
    list-style: none;
    padding: 0;
    margin: 6px 0 0;
    color: var(--erreur);
    font-size: .875rem;
    font-weight: 500;
}

.errorlist.nonfield {
    margin: 0 0 8px;
    padding: 10px 14px;
    border-radius: var(--rayon-petit);
    background: var(--erreur-fond);
}

/* ----------------------------------------------------------------- tableau de bord */
.bonjour {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin: 8px 0 24px;
}

.bonjour h1 { margin: 0; font-size: clamp(1.8rem, 3.4vw, 2.5rem); }
.bonjour p { margin: 4px 0 0; color: var(--encre-douce); }

.tuiles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.tuile {
    background: var(--surface);
    border: 1px solid var(--ligne);
    border-radius: var(--rayon);
    padding: 20px;
    box-shadow: var(--ombre);
    display: grid;
    gap: 4px;
}

a.tuile { color: inherit; text-decoration: none; }

.tuile__libelle {
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: var(--encre-douce);
    font-weight: 700;
}

.tuile__valeur {
    font-family: var(--police-titre);
    font-size: 2.3rem;
    font-weight: 500;
    letter-spacing: -.02em;
    font-variant-numeric: tabular-nums;
    line-height: 1.1;
}

.tuile__valeur small { font-family: var(--police); font-size: .95rem; font-weight: 500; color: var(--encre-douce); margin-left: 6px; }

/* la première tuile est le ciel */
.tuile--accent { background: linear-gradient(180deg, var(--nuit), var(--prune-700)); border-color: transparent; color: #fff; }
.tuile--accent .tuile__libelle { color: var(--soleil-300); }
.tuile--accent .tuile__valeur small { color: rgba(255, 255, 255, .75); }
.tuile--indigo { background: var(--surface-2); }

.section-titre {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin: 0 0 12px;
}
.section-titre h2 { margin: 0; font-size: 1.35rem; }
.section-titre span { color: var(--encre-douce); font-size: .9rem; }

.alarmes {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.alarme {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--ligne);
    border-radius: var(--rayon);
    padding: 20px;
    box-shadow: var(--ombre);
    display: grid;
    gap: 14px;
    overflow: hidden;
}

/* la ligne d'horizon en tête de carte : prune pour un salon privé, corail pour un salon public */
.alarme::before {
    content: "";
    position: absolute;
    left: 20px;
    right: 20px;
    top: 0;
    height: 3px;
    border-radius: 0 0 3px 3px;
    background: var(--prune-500);
}
.alarme--publique::before { background: var(--aurore-500); }

.alarme__haut { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }

.alarme__heure {
    font-family: var(--police-titre);
    font-size: 2.8rem;
    font-weight: 400;
    letter-spacing: -.03em;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    background: var(--badge-prive-fond);
    color: var(--badge-prive-texte);
}
.badge--publique { background: var(--badge-public-fond); color: var(--badge-public-texte); }

.alarme__code { color: var(--encre-douce); font-size: .95rem; margin: 0; }
.alarme__code code {
    font-family: var(--police);
    font-weight: 600;
    background: var(--surface-2);
    padding: 2px 8px;
    border-radius: 6px;
    color: var(--encre);
}

.jours { display: flex; gap: 6px; }

.jour {
    flex: 1;
    text-align: center;
    padding: 6px 0;
    border-radius: 8px;
    font-size: .8rem;
    font-weight: 700;
    background: var(--fond);
    color: var(--encre-douce);
}
.jour--actif { background: var(--principal); color: var(--sur-principal); }

.alarme__pied { display: flex; justify-content: space-between; color: var(--encre-douce); font-size: .875rem; }

.vide {
    background: var(--surface);
    border-radius: var(--rayon);
    border: 2px dashed var(--ligne);
    padding: 40px 24px;
    text-align: center;
    color: var(--encre-douce);
}
.vide strong { display: block; color: var(--encre); font-size: 1.1rem; margin-bottom: 6px; font-family: var(--police-titre); }

/* ----------------------------------------------------------------- accueil visiteur */
.hero {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    gap: 40px;
    align-items: center;
    padding: 32px 0;
}

.hero h1 {
    font-size: clamp(2.4rem, 5.2vw, 3.8rem);
    margin: 0 0 16px;
}
.hero h1 em { font-style: italic; color: var(--accent-texte); }
.hero p { font-size: 1.15rem; color: var(--encre-douce); margin: 0 0 28px; max-width: 46ch; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; }

.hero__visuel {
    aspect-ratio: 1;
    /* largeur explicite : un div vide avec des marges auto dans une grille se réduirait à 0 */
    width: min(100%, 380px);
    justify-self: center;
    box-shadow: var(--ombre);
}

/* dans le visuel d'accueil, le soleil est au centre et plus grand, la terre plus haute */
.hero__visuel::before {
    right: auto;
    left: 26%;
    width: 48%;
    max-width: none;
    bottom: 26%;
}
.hero__visuel::after { height: 26%; }

.hero__heure {
    position: absolute;
    top: 12%;
    left: 0;
    right: 0;
    text-align: center;
    color: #fff;
    font-family: var(--police-titre);
    font-size: 3.4rem;
    letter-spacing: -.03em;
    font-variant-numeric: tabular-nums;
}

.hero__personnes {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 8%;
    display: flex;
    justify-content: center;
    gap: 12px;
}

.hero__personnes span {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--soleil-100);
    border: 3px solid var(--prune-700);
    display: grid;
    place-items: center;
    font-weight: 700;
    color: var(--nuit);
    font-size: .9rem;
}

@media (max-width: 820px) {
    .hero { grid-template-columns: 1fr; padding: 8px 0; }
    .hero__visuel { max-width: 280px; }
}

/* Pages « mon compte » et mot de passe : carte seule, centrée */
.carte--centree { max-width: 560px; margin: 0 auto; }
.offres .alarme__pied form { margin: 0; }
.offres .bouton[disabled] { opacity: .5; cursor: not-allowed; }

.liens-compte { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 20px; }
.encart { margin: 0 0 20px; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--ligne); font-size: .95rem; }
.alarme__heure small { font-family: var(--police); font-size: .8rem; font-weight: 500; color: var(--encre-douce); margin-left: 4px; }

/* ----------------------------------------------------------------- date de naissance (saisie + calendrier) */
.dn { position: relative; }
.dn input { padding-right: 52px; }
.dn__bouton {
    position: absolute; top: 0; right: 0; width: 48px; height: 48px;
    display: inline-flex; align-items: center; justify-content: center;
    background: transparent; border: 0; border-radius: var(--rayon-petit);
    color: var(--principal); cursor: pointer;
}
.dn__bouton:hover { background: var(--surface-2); }
.dn__panneau {
    position: absolute; z-index: 10; left: 0; right: 0; top: calc(100% + 6px);
    max-width: 340px; padding: 12px;
    background: var(--surface); border: 1px solid var(--ligne);
    border-radius: var(--rayon-petit); box-shadow: var(--ombre);
}
.dn__panneau[hidden] { display: none; }
.dn__entete { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; min-height: 40px; }
.dn__titre { font-family: var(--police-titre); font-weight: 500; text-align: center; flex: 1; text-transform: capitalize; }
.dn__fleches { display: inline-flex; gap: 2px; min-width: 56px; justify-content: flex-end; }
.dn__nav {
    min-height: 40px; min-width: 40px; padding: 0 10px; background: transparent; border: 0;
    border-radius: 999px; color: var(--principal); font: inherit; font-weight: 600; cursor: pointer;
}
.dn__nav:hover { background: var(--surface-2); }
.dn__grille { display: grid; gap: 6px; }
.dn__grille--3 { grid-template-columns: repeat(3, 1fr); }
.dn__grille--7 { grid-template-columns: repeat(7, 1fr); gap: 4px; }
.dn__case {
    min-height: 44px; border-radius: var(--rayon-petit); border: 1px solid var(--ligne);
    background: var(--fond); color: var(--encre); font: inherit; cursor: pointer;
}
.dn__grille--7 .dn__case { min-height: 40px; padding: 0; border-color: transparent; }
.dn__case:hover:not(:disabled) { border-color: var(--principal); }
.dn__case:disabled { opacity: .35; cursor: default; }
.dn__case--choisie { background: var(--principal); color: var(--sur-principal); border-color: var(--principal); font-weight: 700; }
.dn__jour-nom { text-align: center; font-size: .8rem; color: var(--encre-douce); padding: 4px 0; }
