@font-face {
    font-family: "Manrope";
    src: url("fonts/manrope.ttf") format("truetype");
    font-weight: 400 800;
    font-display: swap;
}

:root {
    color-scheme: light;
    --navy: #0a1a2f;
    --navy-2: #102945;
    --navy-3: #1a3a5b;
    --amber: #e9a23b;
    --gold: #f6c66e;
    --cream: #fdf3e1;
    --ink: #14243a;
    --muted: #66768d;
    --faint: #8997a9;
    --line: #e4eaf2;
    --surface: #ffffff;
    --page: #f3f6fa;
    --danger: #b83d43;
    --danger-bg: #fff0ef;
    --danger-line: #f4d0ce;
}

*, *::before, *::after { box-sizing: border-box; }
html { min-height: 100%; -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    min-height: 100vh;
    min-height: 100svh;
    background: var(--page);
    color: var(--ink);
    font-family: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
    -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; }

.auth-page {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    min-height: 100svh;
    display: grid;
    place-items: center;
    padding: 34px;
}
.auth-shell {
    width: min(1160px, 100%);
    min-height: min(720px, calc(100svh - 68px));
    display: grid;
    grid-template-columns: 1fr 1fr;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    border-radius: 26px;
    background: var(--surface);
    box-shadow: 0 28px 74px -36px rgba(10, 26, 47, .30), 0 5px 18px rgba(10, 26, 47, .05);
}

/* Panneau de marque : reprend le navy et les accents ambre du dashboard V14. */
.auth-aside {
    position: relative;
    isolation: isolate;
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
    padding: 42px 46px 32px;
    background: linear-gradient(145deg, #071629 0%, var(--navy) 55%, #102945 100%);
    color: #fff;
}
.auth-aside::before,
.auth-aside::after {
    position: absolute;
    z-index: -1;
    content: "";
    pointer-events: none;
    border-radius: 50%;
}
.auth-aside::before {
    width: 430px;
    height: 430px;
    right: -190px;
    top: 115px;
    border: 1px solid rgba(246, 198, 110, .12);
    box-shadow: 0 0 0 34px rgba(246, 198, 110, .025), 0 0 0 78px rgba(246, 198, 110, .02);
}
.auth-aside::after {
    width: 280px;
    height: 280px;
    left: -170px;
    bottom: -160px;
    background: radial-gradient(circle, rgba(233, 162, 59, .16), transparent 68%);
}
.auth-brand {
    display: flex;
    align-items: center;
    min-height: 46px;
}
.brand-logo-full {
    display: block;
    width: auto;
    height: 43px;
    max-width: 245px;
    object-fit: contain;
    object-position: left center;
}
.brand-logo-ico { display: none; }
.aside-copy { margin-top: auto; padding: 43px 0 22px; }
.aside-kicker,
.form-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .13em;
    text-transform: uppercase;
}
.aside-kicker { color: #f6c66e; }
.aside-kicker::before {
    width: 7px;
    height: 7px;
    content: "";
    border-radius: 50%;
    background: var(--amber);
    box-shadow: 0 0 0 4px rgba(233, 162, 59, .12);
}
.aside-title {
    max-width: 480px;
    margin: 19px 0 14px;
    color: #fff;
    font-size: clamp(34px, 3.25vw, 46px);
    font-weight: 800;
    line-height: 1.12;
    letter-spacing: -.055em;
}
.aside-title em { color: var(--gold); font-style: normal; }
.aside-lede {
    max-width: 410px;
    margin: 0;
    color: rgba(238, 244, 251, .72);
    font-size: 14px;
    font-weight: 500;
    line-height: 1.75;
}

/* Décoratif uniquement : aperçu du type de données suivi dans le back-office. */
.auth-preview {
    width: min(420px, 100%);
    margin: 20px 0 22px;
    padding: 16px 17px 14px;
    border: 1px solid rgba(255, 255, 255, .13);
    border-radius: 17px;
    background: linear-gradient(135deg, rgba(255,255,255,.10), rgba(255,255,255,.045));
    box-shadow: 0 18px 40px rgba(0,0,0,.16);
    backdrop-filter: blur(8px);
}
.preview-head,
.preview-foot,
.preview-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.preview-head { color: rgba(255,255,255,.72); font-size: 9px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.preview-live { display: inline-flex; align-items: center; gap: 5px; color: #d4f5e5; font-size: 9px; font-weight: 700; letter-spacing: .02em; text-transform: none; }
.preview-live i { width: 6px; height: 6px; border-radius: 50%; background: #55d7a0; box-shadow: 0 0 0 3px rgba(85,215,160,.12); }
.preview-label-row { margin-top: 14px; align-items: flex-end; }
.preview-label-row strong { display: block; color: #fff; font-size: 17px; font-weight: 800; letter-spacing: -.03em; }
.preview-label-row span { display: block; margin-top: 3px; color: rgba(255,255,255,.56); font-size: 9px; font-weight: 600; }
.preview-pill { padding: 5px 9px; border: 1px solid rgba(246,198,110,.28); border-radius: 999px; color: var(--gold); font-size: 9px; font-weight: 800; }
.preview-chart { height: 66px; display: flex; align-items: flex-end; gap: 8px; margin-top: 10px; padding: 3px 2px 0; border-bottom: 1px solid rgba(255,255,255,.12); }
.preview-chart i { flex: 1; min-width: 6px; border-radius: 5px 5px 1px 1px; background: linear-gradient(180deg, #f6c66e, #e9a23b); opacity: .88; }
.preview-foot { margin-top: 10px; color: rgba(255,255,255,.54); font-size: 9px; font-weight: 600; }
.preview-foot b { color: rgba(255,255,255,.84); font-weight: 700; }
.aside-points { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; }
.aside-point {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 10px;
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 999px;
    color: rgba(255,255,255,.72);
    font-size: 9px;
    font-weight: 700;
}
.aside-point svg { width: 13px; height: 13px; color: var(--gold); }

/* Zone du formulaire. */
.auth-main {
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: 34px clamp(34px, 5vw, 64px) 24px;
    background: var(--surface);
}
.auth-main-head { display: flex; justify-content: flex-end; min-height: 32px; }
.secure-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 10px;
    border: 1px solid #e7edf4;
    border-radius: 999px;
    background: #f8fafc;
    color: #61728a;
    font-size: 10px;
    font-weight: 700;
}
.secure-pill svg { width: 13px; height: 13px; color: var(--amber); }
.auth-sheet { width: min(390px, 100%); margin: auto; }
.form-kicker { margin-bottom: 11px; color: #9a6a21; }
h1 {
    margin: 0;
    color: var(--navy);
    font-size: clamp(27px, 2.5vw, 32px);
    font-weight: 800;
    line-height: 1.18;
    letter-spacing: -.05em;
}
.lede {
    margin: 9px 0 0;
    color: var(--muted);
    font-size: 13.5px;
    font-weight: 500;
    line-height: 1.65;
}
.alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-top: 19px;
    padding: 12px 14px;
    border: 1px solid var(--danger-line);
    border-radius: 12px;
    background: var(--danger-bg);
    color: var(--danger);
    font-size: 12.5px;
    font-weight: 700;
    line-height: 1.5;
}
.alert svg { width: 17px; height: 17px; flex: none; margin-top: 1px; stroke: currentColor; }
form { display: flex; flex-direction: column; gap: 17px; margin-top: 26px; }
.field { display: flex; flex-direction: column; gap: 7px; }
.field label { color: #40546f; font-size: 12px; font-weight: 800; }
.control { position: relative; display: flex; align-items: center; }
.control .ico {
    position: absolute;
    left: 14px;
    width: 18px;
    height: 18px;
    color: #8190a4;
    pointer-events: none;
}
.control .ico svg { display: block; width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.control input {
    display: block;
    width: 100%;
    min-height: 52px;
    padding: 13px 47px 13px 44px;
    border: 1px solid #dfe6ef;
    border-radius: 12px;
    outline: none;
    background: #f9fbfd;
    color: var(--ink);
    font: 600 14px/1.4 "Manrope", system-ui, sans-serif;
    appearance: none;
    -webkit-appearance: none;
    transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}
.control input::placeholder { color: #a1adbb; font-weight: 500; }
.control:focus-within .ico { color: #b77b20; }
.control input:focus {
    border-color: var(--amber);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(233, 162, 59, .16);
}
.code-input { text-align: center; font-size: 20px !important; font-weight: 800 !important; letter-spacing: .42em; }
.toggle-pass {
    position: absolute;
    right: 5px;
    display: grid;
    width: 40px;
    height: 40px;
    place-items: center;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: #718096;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.toggle-pass:hover { background: #edf2f7; color: var(--navy); }
.toggle-pass:focus-visible { outline: 3px solid rgba(233,162,59,.4); outline-offset: 1px; }
.toggle-pass svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.btn-login {
    position: relative;
    display: block;
    width: 100%;
    min-height: 52px;
    margin-top: 3px;
    padding: 10px 54px;
    border: 1px solid var(--navy);
    border-radius: 12px;
    background: var(--navy);
    color: #fff;
    font: 800 13.5px/1.2 "Manrope", system-ui, sans-serif;
    cursor: pointer;
    transition: background .16s ease, border-color .16s ease, transform .16s ease, box-shadow .16s ease;
    -webkit-tap-highlight-color: transparent;
}
.btn-login::after {
    position: absolute;
    top: 50%;
    right: 9px;
    display: grid;
    width: 32px;
    height: 32px;
    place-items: center;
    border-radius: 50%;
    background: rgba(246,198,110,.17);
    color: var(--gold);
    content: "→";
    font-size: 17px;
    transform: translateY(-50%);
}
.btn-login:hover { border-color: var(--navy-2); background: var(--navy-2); box-shadow: 0 8px 18px rgba(10,26,47,.16); }
.btn-login:active { transform: translateY(1px); }
.btn-login:disabled { cursor: wait; opacity: .7; box-shadow: none; }
.btn-login:focus-visible { outline: 3px solid rgba(233,162,59,.45); outline-offset: 3px; }
.forgot {
    display: block;
    width: fit-content;
    min-height: 44px;
    margin: 9px auto 0;
    padding: 12px 6px;
    color: #5c6d83;
    font-size: 12.5px;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
    transition: color .15s ease;
}
.forgot:hover { color: #a86c16; text-decoration: underline; text-underline-offset: 3px; }
.step-links { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; margin-top: 8px !important; }
.step-links button,
.step-links a {
    min-height: 40px;
    padding: 10px 4px;
    border: 0;
    background: none;
    color: #5c6d83 !important;
    font: 700 12px/1.4 "Manrope", system-ui, sans-serif;
    cursor: pointer;
    text-decoration: none !important;
}
.step-links button:hover,
.step-links a:hover { color: #a86c16 !important; }
.auth-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: auto;
    padding-top: 22px;
    color: #8995a5;
    font-size: 10px;
    font-weight: 600;
    text-align: center;
}
.auth-footer-sep { color: #c3ccd6; }
#toastZone { position: relative; z-index: 20; }
.toast {
    position: fixed;
    z-index: 9999;
    top: calc(16px + env(safe-area-inset-top));
    left: 50%;
    width: min(92vw, 430px);
    padding: 13px 16px;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: #fff;
    box-shadow: 0 12px 32px rgba(10,26,47,.14);
    color: var(--ink);
    font-size: 12.5px;
    font-weight: 700;
    transform: translateX(-50%);
}
.toast-success { border-left: 4px solid #15946b; }
.toast-error { border-left: 4px solid #cf4c4c; }

@media (max-width: 900px) {
    .auth-page { padding: 22px; }
    .auth-shell { grid-template-columns: .86fr 1.14fr; min-height: min(700px, calc(100svh - 44px)); }
    .auth-aside { padding: 34px 30px 28px; }
    .auth-main { padding: 30px 34px 22px; }
    .aside-title { font-size: clamp(31px, 4vw, 40px); }
    .auth-preview { margin-top: 15px; }
}
@media (max-width: 720px) {
    .auth-page { display: block; min-height: 100svh; padding: 0; background: var(--page); }
    .auth-shell { display: flex; min-height: 100svh; flex-direction: column; width: 100%; border: 0; border-radius: 0; box-shadow: none; }
    .auth-aside { flex: none; min-height: 0; padding: 22px 22px 24px; }
    .brand-logo-full { height: 35px; max-width: 205px; }
    .brand-logo-ico { display: none; }
    .aside-copy { margin: 0; padding: 22px 0 0; }
    .aside-kicker { font-size: 9px; }
    .aside-title { max-width: 520px; margin: 10px 0 8px; font-size: clamp(26px, 7vw, 34px); line-height: 1.14; }
    .aside-lede { max-width: 520px; font-size: 12px; line-height: 1.55; }
    .auth-preview, .aside-points { display: none; }
    .auth-main { flex: 1; padding: 21px 22px 16px; }
    .auth-main-head { min-height: 28px; }
    .secure-pill { padding: 6px 9px; font-size: 9px; }
    .auth-sheet { margin: 20px auto auto; max-width: 460px; }
    h1 { font-size: 27px; }
    .lede { font-size: 12.5px; }
    form { gap: 15px; margin-top: 22px; }
    .control input { min-height: 50px; }
    .btn-login { min-height: 50px; }
    .auth-footer { margin-top: auto; padding-top: 22px; font-size: 9px; }
}
@media (max-width: 380px) {
    .auth-aside { padding-left: 18px; padding-right: 18px; }
    .auth-main { padding-left: 18px; padding-right: 18px; }
    .aside-title { font-size: 25px; }
    .auth-sheet { margin-top: 15px; }
    .control input { font-size: 13px; }
}
@media (max-height: 760px) and (min-width: 721px) {
    .auth-page { padding-top: 18px; padding-bottom: 18px; }
    .auth-shell { min-height: 0; }
    .auth-aside { padding-top: 28px; padding-bottom: 24px; }
    .aside-copy { padding-top: 28px; }
    .auth-preview { margin-top: 14px; margin-bottom: 14px; }
    .auth-main { padding-top: 22px; padding-bottom: 18px; }
    .auth-footer { padding-top: 14px; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
