/* Le Jardin Gourmet — palette extraite de la carte et du logo */
:root {
    --forest-950: #04170c;
    --forest-900: #0d3d20;   /* vert profond */
    --forest-700: #17572f;   /* vert principal */
    --forest-500: #2f7d3e;   /* feuillage */
    --forest-400: #4a9a55;   /* vert clair */
    --gold-700: #a67c2b;     /* or foncé (logo) */
    --gold-500: #d4af5a;     /* or principal */
    --gold-300: #ecd08a;     /* or clair */
    --ivory: #f7f3e6;

    --sans: 'Poppins', system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
    margin: 0;
    font-family: var(--sans);
    color: var(--ivory);
    background: var(--forest-950) url('../images/fond-vert.jpg') center / cover no-repeat fixed;
    -webkit-font-smoothing: antialiased;
}

.login { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr); overflow-x: clip; }

/* ---------- Scène : la carte se place dans la zone verte libre du fond ---------- */
.stage {
    position: relative;
    display: grid; place-items: center; grid-template-columns: minmax(0, 1fr);
    padding: 2rem 1.25rem; min-width: 0;
}
@media (min-width: 900px) {
    .stage { justify-self: end; width: 56%; }
}

/* anneau doré : écho de l'assiette du logo */
.ring {
    position: absolute; top: 50%; left: 50%;
    width: min(38rem, 92vw); aspect-ratio: 1;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    border: 1px solid rgba(236,208,138,.35);
    background: radial-gradient(circle, rgba(74,154,85,.28), rgba(74,154,85,0) 68%);
    pointer-events: none;
}

.card {
    position: relative;
    width: 100%; max-width: 24rem; min-width: 0;
    padding: 1.75rem 1.75rem 1.25rem;
    background: linear-gradient(165deg, rgba(74,154,85,.92) 0%, rgba(23,87,47,.95) 48%, rgba(13,61,32,.98) 100%);
    border: 1px solid rgba(255,255,255,.18);
    border-radius: 26px;
    box-shadow: 0 30px 70px -20px rgba(0,0,0,.65), inset 0 1px 0 rgba(255,255,255,.28);
}

.card__head { text-align: center; margin-bottom: 1.25rem; }
.badge {
    display: grid; place-items: center;
    width: 4.2rem; height: 4.2rem; margin: 0 auto .8rem;
    background: linear-gradient(180deg, #fff, var(--ivory));
    border-radius: 18px;
    box-shadow: 0 10px 20px -8px rgba(0,0,0,.5), inset 0 -2px 0 rgba(166,124,43,.25);
}
.badge img { width: 3.2rem; height: auto; }
.card__head h1 { margin: 0; font-size: 1.2rem; font-weight: 500; letter-spacing: .01em; color: #fff; }
.card__head p { margin: .3rem 0 0; font-size: .85rem; color: rgba(255,255,255,.8); }
.card__head em { color: var(--gold-300); }

/* ---------- Formulaire ---------- */
.form { display: grid; gap: .9rem; }
.field label { display: block; margin: 0 0 .35rem .35rem; font-size: .8rem; color: rgba(255,255,255,.9); }

.control { min-width: 0; max-width: 100%;
    display: flex; align-items: center; gap: .7rem;
    padding: 0 1rem; height: 2.8rem;
    background: rgba(4,23,12,.32);
    border: 1px solid rgba(255,255,255,.14);
    border-radius: 999px;
    transition: border-color .2s, box-shadow .2s, background .2s;
}
.control:focus-within { border-color: var(--gold-300); background: rgba(4,23,12,.45); box-shadow: 0 0 0 3px rgba(236,208,138,.22); }
.control svg { width: 1rem; height: 1rem; flex: none; fill: none; stroke: rgba(255,255,255,.85); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.control input { flex: 1; min-width: 0; width: 100%; height: 100%; background: none; border: 0; outline: 0; color: #fff; font: inherit; font-size: .9rem; }
.control input::placeholder { color: rgba(255,255,255,.5); }
.eye { background: none; border: 0; padding: .2rem; cursor: pointer; display: grid; }
.eye:hover svg { stroke: var(--gold-300); }

.row { display: flex; justify-content: space-between; align-items: center; gap: .5rem; padding: 0 .35rem; font-size: .8rem; }
.row a { color: rgba(255,255,255,.85); text-decoration: underline; text-underline-offset: 3px; transition: color .2s; }
.row a:hover { color: var(--gold-300); }
.check { display: flex; align-items: center; gap: .55rem; color: rgba(255,255,255,.85); cursor: pointer; position: relative; }
.check input { position: absolute; opacity: 0; }
.check__box { width: 1.05rem; height: 1.05rem; background: #fff; border-radius: 4px; display: grid; place-items: center; flex: none; }
.check input:checked + .check__box { background: var(--gold-300); }
.check input:checked + .check__box::after { content: ''; width: .28rem; height: .5rem; border: solid var(--forest-900); border-width: 0 2px 2px 0; transform: rotate(45deg) translate(-1px,-1px); }
.check input:focus-visible + .check__box { box-shadow: 0 0 0 3px rgba(236,208,138,.5); }

.btn {
    margin-top: .2rem; height: 2.9rem; border: 0; border-radius: 999px; cursor: pointer;
    font: 600 .95rem var(--sans); letter-spacing: .04em;
    color: var(--forest-950);
    background: linear-gradient(100deg, var(--gold-700), var(--gold-300) 50%, var(--gold-500));
    box-shadow: 0 10px 22px -10px rgba(0,0,0,.6), inset 0 1px 0 rgba(255,255,255,.45);
    transition: transform .2s, filter .2s;
}
.btn:hover { transform: translateY(-1px); filter: brightness(1.07); }
.btn:focus-visible, .row a:focus-visible, .eye:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }

.card__foot { margin-top: 1.1rem; text-align: center; font-size: .7rem; letter-spacing: .2em; text-transform: uppercase; color: rgba(255,255,255,.6); }

@media (max-width: 899px) {
    body { background-position: 15% center; }
    .card { max-width: 22rem; }
}
@media (max-width: 420px) { .card { padding: 1.5rem 1.25rem 1.1rem; } }
@media (max-width: 360px) {
    .row { flex-direction: column; align-items: flex-start; gap: .6rem; }
    .check, .row a { white-space: nowrap; }
    .card__foot { letter-spacing: .1em; }
}

/* ---------- Erreurs ---------- */
.alert { margin: 0; padding: .65rem .9rem; border-radius: 12px; font-size: .84rem; line-height: 1.4; color: #fff; background: rgba(160,32,32,.55); border: 1px solid rgba(255,170,170,.5); }
.control--error { border-color: rgba(255,170,170,.7); }
.alert--ok { background: rgba(212,175,90,.22); border-color: rgba(236,208,138,.6); }
.field__error { margin: .35rem 0 0 .35rem; font-size: .78rem; color: #ffc9c9; }
.row--end { justify-content: flex-end; }
.back { text-align: center; font-size: .84rem; color: rgba(255,255,255,.85); text-decoration: none; }
.back:hover { color: var(--gold-300); }
.back:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }

/* ---------- Loader du bouton ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .6rem; }
.btn.is-loading { cursor: progress; pointer-events: none; filter: brightness(.95); transform: none; }
.btn.is-loading::before {
    content: ''; width: 1.05rem; height: 1.05rem; flex: none;
    border: 2px solid rgba(4,23,12,.25); border-top-color: var(--forest-950); border-radius: 50%;
    animation: btn-spin .7s linear infinite;
}
@keyframes btn-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .btn.is-loading::before { animation-duration: 1.6s; } }
