/*
 * Page de connexion de la gestion : à gauche le comptoir de la cantine (illustration originale) et la vie d'un ticket,
 * à droite le formulaire. Un seul mouvement : le ticket sort de l'imprimante à l'ouverture.
 */
@font-face { font-family: "Bricolage"; src: url("/assets/fonts/bricolage-grotesque-latin-800-normal.woff2") format("woff2"); font-weight: 800; font-display: swap; }
@font-face { font-family: "Bricolage"; src: url("/assets/fonts/bricolage-grotesque-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
    --forest: #12302A;
    --forest-deep: #0E2721;
    --leaf: #2E6B4F;
    --mint: #DCE9E3;
    --saffron: #E9A83B;
    --display: "Bricolage", var(--font);
}

body.page-login { background: var(--surface); }
.login-page { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(380px, 1fr); }

/* ---------- Le comptoir ---------- */
.login-story {
    background: var(--forest); color: #F2F6F3; padding: 32px 48px 32px; height: 100vh; min-height: 640px; position: sticky; top: 0;
    display: flex; flex-direction: column; gap: 14px; min-width: 0;
}
.login-brand { display: flex; align-items: center; gap: 12px; }
.login-brand .brand-mark { background: #F2F6F3; color: var(--forest); }
.login-brand-name { font-family: var(--display); font-weight: 700; font-size: 20px; letter-spacing: .01em; }
.login-headline {
    font-family: var(--display); font-weight: 800; font-size: clamp(32px, 3.2vw, 48px); line-height: 1.02;
    letter-spacing: -0.02em; margin: 18px 0 0; max-width: 15ch; color: #FFFFFF;
}
.login-lede { margin: 0; max-width: 46ch; font-size: 17px; line-height: 1.55; color: #C9DDD2; }

.scene { width: 100%; max-width: 640px; height: auto; max-height: calc(100vh - 400px); min-height: 220px; display: block; border-radius: 18px; margin-top: 4px; }
.scene-t1 { font: 800 15px var(--display); fill: #1A1D1B; letter-spacing: .08em; }
.scene-t2 { font: 600 11px ui-monospace, Consolas, monospace; fill: #1A1D1B; }
.scene-t3 { font: 800 19px ui-monospace, Consolas, monospace; fill: #1A1D1B; }
.scene-ok { font: 700 16px var(--display); fill: #FFFFFF; }
.scene-note { font: 800 15px var(--display); fill: #24563A; }
.scene-menu-h { font: 800 22px var(--display); fill: #F2F6F3; }
.scene-menu { font: 700 17px var(--display); fill: #DCE9E3; }
.scene-menu-s { font: 600 12px var(--font); fill: #9DBFAE; }
.scene-coin { font: 800 8px var(--font); fill: #7A5410; }

/* Le ticket sort de l'imprimante, puis le verdict « Accepté » apparaît. */
.scene-ticket { animation: print 1.6s cubic-bezier(.3, .7, .2, 1) .2s both; }
.scene-badge { animation: badge .35s ease-out 1.7s both; transform-box: fill-box; transform-origin: center; }
@keyframes print { from { transform: translateY(-236px); } to { transform: none; } }
@keyframes badge { from { opacity: 0; transform: scale(.85); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .scene-ticket, .scene-badge { animation: none; } }

/* La vie d'un ticket : trois étapes reliées par une perforation. */
.login-journey { list-style: none; margin: auto 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; position: relative; }
.login-journey::before {
    content: ""; position: absolute; left: 6px; right: 6px; top: 6px; border-top: 2px dashed rgba(220, 233, 227, .45);
}
.login-journey li { position: relative; padding: 24px 16px 0 0; display: flex; flex-direction: column; gap: 4px; font-size: 14px; color: #C9DDD2; }
.login-journey li::before {
    content: ""; position: absolute; left: 0; top: 0; width: 14px; height: 14px; border-radius: 50%;
    background: var(--forest); border: 3px solid var(--saffron);
}
.login-journey li:last-child::before { background: var(--saffron); }
.login-journey .t { font-family: var(--display); font-weight: 700; font-size: 20px; color: #FFFFFF; font-variant-numeric: tabular-nums; }
.login-journey strong { display: block; color: #FFFFFF; font-weight: 700; }

/* ---------- Le formulaire ---------- */
.login-panel { display: flex; align-items: center; justify-content: center; padding: 48px 40px; background: var(--surface); }
.login-form-wrap { width: 100%; max-width: 400px; display: flex; flex-direction: column; gap: 18px; }
.login-title { font-family: var(--display); font-weight: 800; font-size: 32px; line-height: 1.1; letter-spacing: -0.015em; margin: 0; color: var(--ink); }
.login-sub { margin: -8px 0 4px; color: var(--muted); }
.login-form { display: flex; flex-direction: column; gap: 16px; }
.login-form .field input { min-height: 52px; font-size: 16px; border-radius: 12px; }
.login-form .field input:focus { border-color: var(--forest); box-shadow: 0 0 0 4px var(--mint); }
.password { position: relative; }
.password input { width: 100%; padding-right: 96px; }
.password-toggle {
    position: absolute; right: 6px; top: 50%; transform: translateY(-50%); min-height: 40px; padding: 0 12px;
    border: 0; border-radius: 9px; background: var(--soft); color: var(--ink); font: 600 14px var(--font); cursor: pointer;
}
.password-toggle:focus-visible { outline: 3px solid var(--forest); outline-offset: 1px; }
.caps { margin: 2px 0 0; font-size: 13px; font-weight: 700; color: var(--amber-ink); }
.login-submit { min-height: 54px; font-size: 17px; border-radius: 12px; margin-top: 4px; }
.login-help { border-top: 1px solid var(--line); padding-top: 16px; display: flex; flex-direction: column; gap: 8px; font-size: 14px; color: var(--muted); }
.login-help p { margin: 0; }
.login-help strong { color: var(--ink); }

@media (prefers-color-scheme: dark) {
    .login-panel, body.page-login { background: var(--bg); }
}

/* Tablette et téléphone : le formulaire d'abord visible, le comptoir en bandeau au-dessus. */
@media (max-width: 1000px) {
    .login-page { grid-template-columns: 1fr; }
    .login-story { padding: 24px 20px 20px; gap: 12px; height: auto; min-height: 0; position: static; }
    .login-headline { font-size: 30px; margin-top: 6px; max-width: none; }
    .login-lede { font-size: 15px; }
    .scene { max-height: 240px; object-fit: cover; }
    .login-journey { display: none; }
    .login-panel { padding: 28px 16px 40px; align-items: flex-start; }
}
@media (max-width: 560px) {
    .scene, .login-lede { display: none; }
}
