@import url("tokens.css");
@import url("https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,600;9..144,700&family=Nunito:wght@400;600;700;800&display=swap");

/* ============================================================
   Kokoto — Feuille principale du site vitrine
   Base crème, accents moutarde/ocre, rondeur généreuse.
   ============================================================ */

/* Correctif AA : l'ocre clair (#A9761A) = 3.32–3.68:1 en texte fin, sous le
   seuil 4.5:1. On mappe le texte/lien coloré sur l'ocre profond (7.9:1).
   Le dark mode garde --accent-text = moutarde clair (10.6:1, déjà conforme). */
:root {
    --accent-text: var(--kokoto-ocre-profond);
    /* --error (#C2553F) = 3.8–4.2:1 : OK en bordure/icône (composant, seuil 3:1)
       mais sous 4.5:1 en texte. Variante assombrie pour le TEXTE d'erreur. */
    --error-text: #A8412C;
}
[data-theme="dark"] {
    /* En sombre, le rouge assombri (#A8412C) tombe à 2.8:1 — variante claire. */
    --error-text: #E8836E;
}

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

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: var(--font-body);
    font-size: 1.05rem;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-family: var(--font-display); line-height: 1.15; font-weight: 600; }
h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); }
h2 { font-size: clamp(1.7rem, 3.5vw, 2.4rem); }
h3 { font-size: 1.3rem; }

a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; }

img, svg { max-width: 100%; }

.skip-link {
    position: absolute; left: -999px; top: 0;
    background: var(--accent); color: var(--on-accent);
    padding: .6rem 1rem; border-radius: var(--radius-sm); z-index: 100;
}
.skip-link:focus { left: 1rem; top: 1rem; }

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

/* — Conteneur — */
.wrap { width: min(1080px, 92vw); margin-inline: auto; }

/* — En-tête / nav — */
.site-header {
    position: sticky; top: 0; z-index: 50;
    display: flex; align-items: center; gap: 1rem;
    padding: .8rem clamp(1rem, 4vw, 2.5rem);
    background: color-mix(in srgb, var(--bg) 88%, transparent);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: .6rem; margin-right: auto; }
.brand a { display: flex; align-items: center; gap: .55rem; color: var(--text); font-weight: 800; font-size: 1.25rem; }
.brand a:hover { text-decoration: none; }
.brand-logo { width: 34px; height: 34px; }
[data-theme="dark"] .brand-logo { filter: invert(1); }
.brand-baseline { font-family: var(--font-display); font-style: italic; color: var(--text-muted); font-size: .95rem; }

#site-nav { display: flex; align-items: center; gap: .35rem; }
#site-nav a {
    color: var(--text); padding: .5rem .85rem; border-radius: var(--radius-pill);
    font-weight: 600; font-size: .98rem;
}
#site-nav a:hover { background: var(--surface); text-decoration: none; }
#site-nav a[aria-current="page"] { background: var(--accent); color: var(--on-accent); }

#nav-toggle, #theme-toggle {
    background: transparent; border: 1px solid var(--border); color: var(--text);
    border-radius: var(--radius-sm); padding: .4rem; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
}
#nav-toggle { display: none; }
#nav-toggle:hover, #theme-toggle:hover { background: var(--surface); }

/* — Boutons — */
.btn, .btn-secondary {
    display: inline-flex; align-items: center; gap: .5rem;
    padding: .8rem 1.5rem; border-radius: var(--radius-pill);
    font-family: var(--font-body); font-weight: 700; font-size: 1rem;
    cursor: pointer; border: 2px solid transparent; transition: transform .12s, background .15s;
}
.btn { background: var(--accent); color: var(--on-accent); }
.btn:hover { background: var(--accent-hover); text-decoration: none; transform: translateY(-1px); }
.btn-secondary { background: transparent; color: var(--text); border-color: var(--border); }
.btn-secondary:hover { background: var(--surface); text-decoration: none; }
.btn:disabled, .btn-secondary:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn:active, .btn-secondary:active { transform: translateY(1px); }

/* — Sections — */
section { padding: clamp(3rem, 7vw, 5.5rem) 0; }
.lead { font-size: 1.25rem; color: var(--text-muted); max-width: 60ch; }

/* — Hero — */
.hero { text-align: center; padding-top: clamp(3rem, 8vw, 6rem); }
.hero h1 { margin: 0 0 .4rem; }
.hero .baseline { font-family: var(--font-display); font-style: italic; font-size: clamp(1.3rem, 3vw, 1.8rem); color: var(--accent-text); }
.hero .lead { margin: 1.4rem auto 2rem; }
.hero-actions { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }
.hero-egg { width: clamp(120px, 22vw, 200px); margin: 0 auto 1.5rem; }
[data-theme="dark"] .hero-egg { filter: invert(1); }

/* — Grille de cartes — */
.cards { display: grid; gap: 1.4rem; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); margin-top: 2rem; }
.card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius-lg); padding: 1.6rem; box-shadow: var(--shadow);
}
.card h3 { margin-top: 0; }
.card .price { font-family: var(--font-display); font-size: 1.8rem; color: var(--accent-text); font-weight: 700; }
.card .price small { font-size: .9rem; color: var(--text-muted); font-weight: 400; }
.card.featured { border-color: var(--accent); border-width: 2px; }
.card .badge {
    display: inline-block; background: var(--accent); color: var(--on-accent);
    font-size: .75rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em;
    padding: .2rem .7rem; border-radius: var(--radius-pill); margin-bottom: .6rem;
}

/* — Listes de garanties / inclusions — */
.feature-list { list-style: none; padding: 0; margin: 1rem 0 0; display: grid; gap: .7rem; }
.feature-list li { display: flex; gap: .6rem; align-items: flex-start; }
.feature-list li::before {
    content: ""; flex: 0 0 1.3rem; height: 1.3rem; margin-top: .15rem;
    background: var(--accent); border-radius: 50%;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23000' d='M9 16.2 4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4z'/%3E%3C/svg%3E") center/72% no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23000' d='M9 16.2 4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4z'/%3E%3C/svg%3E") center/72% no-repeat;
}

/* — Bande d'appel à l'action — */
.cta-band { background: var(--surface); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); text-align: center; }

/* — Pied de page — */
.site-footer {
    border-top: 1px solid var(--border); padding: 2.5rem 0; margin-top: 2rem;
    color: var(--text-muted); font-size: .95rem;
}
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 1.5rem; justify-content: space-between; align-items: center; }
.site-footer nav { display: flex; gap: 1.2rem; flex-wrap: wrap; }

/* — Flash messages — */
.flash { list-style: none; padding: 0; margin: 1rem 0; }
.flash li { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .8rem 1rem; }

/* — Responsive : burger sous 760px — */
@media (max-width: 760px) {
    #nav-toggle { display: inline-flex; }
    #site-nav {
        position: absolute; top: 100%; right: clamp(1rem, 4vw, 2.5rem); left: clamp(1rem, 4vw, 2.5rem);
        flex-direction: column; align-items: stretch; gap: .2rem;
        background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius);
        padding: .6rem; box-shadow: var(--shadow); display: none;
    }
    #site-nav.is-open { display: flex; }
    .brand-baseline { display: none; }
}

/* ============================================================
   Toast + spinner (compatibles toast.js du socle)
   ============================================================ */
.toast-stack {
    position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 10000;
    display: flex; flex-direction: column-reverse; gap: .6rem;
    max-width: 380px; pointer-events: none;
}
.toast {
    background: var(--surface); color: var(--text);
    padding: .8rem 1.1rem; border-radius: var(--radius);
    border: 1px solid var(--border); box-shadow: var(--shadow);
    font-size: .95rem; pointer-events: auto;
    animation: toast-in .3s ease;
}
.toast.error   { border-color: var(--error);   color: var(--error-text); }
.toast.success { border-color: var(--success); color: var(--success); }
.toast.is-leaving { animation: toast-out .25s ease forwards; }
@keyframes toast-in  { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateY(8px); } }

.btn-spinner {
    display: inline-block; width: 13px; height: 13px;
    border: 2px solid currentColor; border-top-color: transparent;
    border-radius: 50%; animation: btn-spin .7s linear infinite;
}
@keyframes btn-spin { to { transform: rotate(360deg); } }
button.is-busy { cursor: progress; }
@media (prefers-reduced-motion: reduce) {
    .toast, .toast.is-leaving, .btn-spinner { animation: none; }
}
