/* =============================================================
   login.css — Connexion à la console d'administration CWS
   Fond anthracite, panneau de formulaire arrondi à droite,
   décor en orbite à gauche. Thème sombre par défaut + clair.
   ============================================================= */
:root {
    --al-primary: #3fa9e6;
    --al-primary-hover: #2a97d6;
    --al-primary-soft: rgba(63,169,230,.14);

    --al-bg: #232326;
    --al-bg-2: #1c1c1f;
    --al-panel: #1d1d20;
    --al-field: #2a2a2e;
    --al-field-line: #3a3a3f;
    --al-line: rgba(255,255,255,.08);
    --al-ring: rgba(255,255,255,.16);
    --al-bubble: #2c2c30;
    --al-wave: rgba(255,255,255,.045);

    --al-tx-1: #ececee;
    --al-tx-2: #b9b9bf;
    --al-tx-3: #85858c;

    --al-danger: #e66b6b;
    --al-font: 'Mulish', ui-sans-serif, system-ui, sans-serif;
    --al-font-head: 'Kufam', ui-sans-serif, system-ui, sans-serif;
    color-scheme: dark;
}
:root[data-login-theme="light"],
html:not([data-theme="dark"]) body.al-site {
    --al-primary: #1e95d4;
    --al-primary-hover: #157fb8;
    --al-primary-soft: rgba(30,149,212,.12);

    --al-bg: #eef0f4;
    --al-bg-2: #e4e7ed;
    --al-panel: #ffffff;
    --al-field: #f6f7f9;
    --al-field-line: #dcdfe5;
    --al-line: rgba(0,0,0,.07);
    --al-ring: rgba(20,30,50,.16);
    --al-bubble: #ffffff;
    --al-wave: rgba(20,30,60,.06);

    --al-tx-1: #23252b;
    --al-tx-2: #50545e;
    --al-tx-3: #868b96;
    color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
.al-body {
    min-height: 100vh;
    font-family: var(--al-font);
    font-size: 14px;
    color: var(--al-tx-2);
    background:
        radial-gradient(60% 70% at 18% 30%, rgba(63,169,230,.10), transparent 70%),
        linear-gradient(160deg, var(--al-bg) 0%, var(--al-bg-2) 100%);
    -webkit-font-smoothing: antialiased;
    transition: background-color .25s ease, color .25s ease;
}
a { color: inherit; }
svg { display: block; }

/* Lignes ondulées du fond */
.al-waves { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; }
.al-waves path { fill: none; stroke: var(--al-wave); stroke-width: 1.5; }

/* ── Structure ─────────────────────────────────────────────── */
.al-shell {
    position: relative; z-index: 1;
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(420px, 560px);
}

/* ── Colonne de présentation ───────────────────────────────── */
.al-intro {
    display: flex; flex-direction: column;
    padding: 2.5rem 3.5rem;
    min-width: 0;
}
.al-brand { display: inline-flex; align-items: center; gap: .65rem; text-decoration: none; align-self: flex-start; }
.al-brand img { width: 40px; height: 40px; object-fit: contain; background: #fff; border-radius: 10px; padding: 3px; }
.al-brand span { font-family: var(--al-font-head); font-size: 1.3rem; font-weight: 700; color: var(--al-tx-1); letter-spacing: .01em; }
.al-brand em { font-style: normal; font-weight: 500; color: var(--al-primary); }

.al-orbit {
    position: relative;
    width: min(440px, 80%); aspect-ratio: 1;
    margin: auto auto 3.5rem;
}
.al-ring { position: absolute; border-radius: 50%; border: 1.5px dashed var(--al-ring); }
.al-ring-1 { inset: 0; animation: al-spin 90s linear infinite; }
.al-ring-2 { inset: 21%; animation: al-spin 70s linear infinite reverse; }
@keyframes al-spin { to { transform: rotate(360deg); } }
.al-orbit-core {
    position: absolute; inset: 36%;
    display: grid; place-items: center;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 20px 50px -20px rgba(0,0,0,.6), 0 0 0 10px var(--al-primary-soft);
}
.al-orbit-core img { width: 62%; height: 62%; object-fit: contain; }
.al-bubble {
    position: absolute; width: 46px; height: 46px; margin: -23px 0 0 -23px;
    display: grid; place-items: center;
    border-radius: 50%;
    background: var(--al-bubble);
    border: 1px solid var(--al-line);
    box-shadow: 0 10px 24px -12px rgba(0,0,0,.55);
    color: var(--al-tx-2);
}
.al-bubble svg { width: 19px; height: 19px; stroke-width: 1.75; }
.al-bubble.b1 { left: 50%;   top: 0;     color: #3fa9e6; }
.al-bubble.b2 { left: 93.3%; top: 25%;   color: #e8a33d; }
.al-bubble.b3 { left: 93.3%; top: 75%;   color: #49c18a; }
.al-bubble.b4 { left: 50%;   top: 100%;  color: #9a7ef0; }
.al-bubble.b5 { left: 6.7%;  top: 75%;   color: #e66b8f; }
.al-bubble.b6 { left: 6.7%;  top: 25%;   color: #3fc1c9; }

.al-intro-text { max-width: 460px; }
.al-intro-text h2 { font-family: var(--al-font-head); font-size: clamp(1.6rem, 2.4vw, 2.1rem); font-weight: 600; line-height: 1.2; color: var(--al-tx-1); margin-bottom: .6rem; }
.al-intro-text p { font-size: .98rem; line-height: 1.6; color: var(--al-tx-3); }

/* ── Panneau du formulaire ─────────────────────────────────── */
.al-panel {
    display: flex; flex-direction: column;
    background: var(--al-panel);
    border-radius: 28px 0 0 28px;
    box-shadow: -30px 0 80px -40px rgba(0,0,0,.6);
    padding: 1.75rem 3rem 1.5rem;
    transition: background-color .25s ease;
}
.al-panel-top { display: flex; align-items: center; justify-content: space-between; }
.al-back {
    display: inline-flex; align-items: center; gap: .4rem;
    font-size: .82rem; font-weight: 600; color: var(--al-tx-3); text-decoration: none;
    transition: color .15s ease;
}
.al-back svg { width: 15px; height: 15px; }
.al-back:hover { color: var(--al-primary); }
.al-theme {
    width: 38px; height: 38px; border-radius: 10px;
    display: grid; place-items: center;
    border: 1px solid var(--al-field-line); background: transparent;
    color: var(--al-tx-2); cursor: pointer;
    transition: color .15s ease, border-color .15s ease;
}
.al-theme:hover { color: var(--al-primary); border-color: var(--al-primary); }
.al-theme svg { width: 17px; height: 17px; }
.al-ico-moon { display: none !important; }
:root[data-login-theme="light"] .al-ico-sun,
html:not([data-theme="dark"]) .al-site .al-ico-sun  { display: none !important; }
:root[data-login-theme="light"] .al-ico-moon,
html:not([data-theme="dark"]) .al-site .al-ico-moon { display: block !important; }

.al-form-wrap { width: 100%; max-width: 380px; margin: auto; padding: 2.5rem 0; }
.al-brand-mobile { display: none; margin-bottom: 2rem; }
.al-kicker {
    display: inline-block;
    font-size: .7rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
    color: var(--al-primary);
    margin-bottom: .7rem;
}
.al-form-wrap h1 { font-family: var(--al-font-head); font-size: 1.9rem; font-weight: 600; color: var(--al-tx-1); line-height: 1.15; margin-bottom: .45rem; }
.al-sub { font-size: .92rem; color: var(--al-tx-3); margin-bottom: 1.9rem; }

.al-alert {
    display: flex; align-items: center; gap: .6rem;
    padding: .75rem .9rem; margin-bottom: 1.25rem;
    border-radius: 10px;
    background: color-mix(in srgb, var(--al-danger) 14%, transparent);
    border: 1px solid color-mix(in srgb, var(--al-danger) 35%, transparent);
    color: var(--al-danger); font-size: .86rem; font-weight: 600;
}
.al-alert svg { width: 17px; height: 17px; flex-shrink: 0; }

.al-form { display: flex; flex-direction: column; gap: 1.1rem; }
.al-field { display: flex; flex-direction: column; gap: .45rem; }
.al-label { font-size: .8rem; font-weight: 700; color: var(--al-tx-2); }
.al-control {
    position: relative; display: flex; align-items: center;
    height: 48px;
    border-radius: 10px;
    background: var(--al-field);
    border: 1px solid var(--al-field-line);
    transition: border-color .15s ease, box-shadow .15s ease;
}
.al-control:focus-within { border-color: var(--al-primary); box-shadow: 0 0 0 4px var(--al-primary-soft); }
.al-control > svg { width: 17px; height: 17px; margin-left: .95rem; color: var(--al-tx-3); flex-shrink: 0; }
.al-control:focus-within > svg { color: var(--al-primary); }
.al-control input {
    flex: 1; min-width: 0; height: 100%;
    padding: 0 .9rem 0 .7rem;
    border: 0; outline: 0; background: transparent;
    font: inherit; font-size: .92rem; color: var(--al-tx-1);
}
.al-control input::placeholder { color: var(--al-tx-3); opacity: .8; }
.al-control input:-webkit-autofill {
    -webkit-text-fill-color: var(--al-tx-1);
    -webkit-box-shadow: 0 0 0 40px var(--al-field) inset;
    caret-color: var(--al-tx-1);
}
.al-eye {
    width: 42px; height: 100%; flex-shrink: 0;
    display: grid; place-items: center;
    border: 0; background: transparent; color: var(--al-tx-3); cursor: pointer;
}
.al-eye:hover { color: var(--al-primary); }
.al-eye svg { width: 17px; height: 17px; }

.al-submit {
    margin-top: .5rem;
    height: 48px; border: 0; border-radius: 10px;
    display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
    background: var(--al-primary); color: #fff;
    font: inherit; font-size: .95rem; font-weight: 700; letter-spacing: .01em;
    cursor: pointer;
    box-shadow: 0 14px 30px -14px var(--al-primary);
    transition: background-color .15s ease, transform .15s ease;
}
.al-submit svg { width: 18px; height: 18px; }
.al-submit:hover { background: var(--al-primary-hover); }
.al-submit:active { transform: translateY(1px); }
.al-submit:focus-visible, .al-theme:focus-visible, .al-eye:focus-visible, .al-back:focus-visible {
    outline: 2px solid var(--al-primary); outline-offset: 2px;
}

.al-secure {
    display: flex; align-items: center; justify-content: center; gap: .45rem;
    margin-top: 1.6rem; padding-top: 1.4rem;
    border-top: 1px solid var(--al-line);
    font-size: .78rem; color: var(--al-tx-3);
}
.al-secure svg { width: 15px; height: 15px; color: #49c18a; }
.al-foot { text-align: center; font-size: .74rem; color: var(--al-tx-3); }

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 1100px) {
    .al-shell { grid-template-columns: minmax(0, 1fr) 460px; }
    .al-intro { padding: 2rem 2.25rem; }
}
@media (max-width: 860px) {
    .al-shell { grid-template-columns: 1fr; padding: 1.25rem; align-content: center; }
    .al-intro { display: none; }
    .al-panel { border-radius: 22px; padding: 1.4rem 1.5rem 1.25rem; min-height: calc(100vh - 2.5rem); }
    .al-brand-mobile { display: inline-flex; }
}
@media (max-width: 420px) {
    .al-shell { padding: 0; }
    .al-panel { border-radius: 0; min-height: 100vh; }
}
@media (prefers-reduced-motion: reduce) {
    .al-ring-1, .al-ring-2 { animation: none; }
}


/* =============================================================
   Compléments pour la connexion travailleur (/connexion)
   ============================================================= */
.al-site { margin: 0; }
.al-site h1, .al-site h2 { letter-spacing: 0; }

/* Le logo CSS est large : on lui donne plus de place */
.al-site .al-brand img,
.al-brand img[src*="css-logo"] { width: 46px; height: 46px; padding: 2px; }
.al-site .al-brand span { font-size: 1.1rem; }
.al-orbit-core img[src*="css-logo"] { width: 78%; height: 78%; }

/* Onglets Se connecter / Créer mon compte */
.al-tabs {
    display: grid; grid-template-columns: 1fr 1fr; gap: 4px;
    padding: 4px; margin-bottom: 1.75rem;
    border-radius: 12px;
    background: var(--al-field);
    border: 1px solid var(--al-field-line);
}
.al-tabs a {
    display: flex; align-items: center; justify-content: center;
    height: 38px; border-radius: 9px;
    font-size: .85rem; font-weight: 700; color: var(--al-tx-3); text-decoration: none;
    transition: background-color .15s ease, color .15s ease;
}
.al-tabs a:hover { color: var(--al-tx-1); }
.al-tabs a.is-on { background: var(--al-panel); color: var(--al-tx-1); box-shadow: 0 2px 8px -2px rgba(0,0,0,.25); }

.al-label small { font-weight: 500; color: var(--al-tx-3); margin-left: .25rem; }
.al-hint { font-size: .76rem; color: var(--al-tx-3); line-height: 1.45; }
.al-code { letter-spacing: .12em; text-transform: uppercase; font-weight: 700; }

.al-alert.is-ok {
    background: color-mix(in srgb, #49c18a 14%, transparent);
    border-color: color-mix(in srgb, #49c18a 35%, transparent);
    color: #2fa56f;
}

/* Rester connecté / mot de passe oublié */
.al-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-top: -.2rem; }
.al-check { display: inline-flex; align-items: center; gap: .5rem; font-size: .82rem; color: var(--al-tx-2); cursor: pointer; }
.al-check input { width: 16px; height: 16px; accent-color: var(--al-primary); cursor: pointer; }
.al-forgot { font-size: .82rem; font-weight: 700; color: var(--al-primary); text-decoration: none; }
.al-forgot:hover { text-decoration: underline; }

/* Séparateur « ou » */
.al-divider { display: flex; align-items: center; gap: .9rem; margin: 1.4rem 0 1.1rem; font-size: .78rem; color: var(--al-tx-3); text-transform: lowercase; }
.al-divider::before, .al-divider::after { content: ''; flex: 1; height: 1px; background: var(--al-line); }

/* Bouton secondaire (code d'accès, plus tard) */
.al-alt {
    display: flex; align-items: center; justify-content: center; gap: .5rem;
    height: 46px; border-radius: 10px;
    border: 1px solid var(--al-field-line); background: transparent;
    font-size: .88rem; font-weight: 700; color: var(--al-tx-1); text-decoration: none;
    transition: border-color .15s ease, color .15s ease, background-color .15s ease;
}
.al-alt svg { width: 17px; height: 17px; color: var(--al-primary); }
.al-alt:hover { border-color: var(--al-primary); color: var(--al-primary); background: var(--al-primary-soft); }

.al-switch { text-align: center; margin-top: .25rem; }
.al-switch a { display: inline-flex; align-items: center; gap: .4rem; font-size: .84rem; font-weight: 700; color: var(--al-primary); text-decoration: none; }
.al-switch a svg { width: 15px; height: 15px; }
.al-switch a:hover { text-decoration: underline; }

/* Carte « Vous êtes une compagnie ? » */
.al-company {
    display: flex; align-items: center; gap: .85rem;
    margin-top: 1rem; padding: .85rem 1rem;
    border-radius: 12px;
    background: var(--al-field);
    border: 1px solid var(--al-field-line);
    color: var(--al-tx-2); text-decoration: none;
    transition: border-color .15s ease, transform .15s ease;
}
.al-company:hover { border-color: var(--al-primary); }
.al-company-ico {
    width: 38px; height: 38px; flex-shrink: 0; border-radius: 10px;
    display: grid; place-items: center;
    background: var(--al-primary-soft); color: var(--al-primary);
}
.al-company-ico svg { width: 18px; height: 18px; }
.al-company-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .1rem; }
.al-company-txt strong { font-size: .86rem; color: var(--al-tx-1); }
.al-company-txt small { font-size: .76rem; color: var(--al-tx-3); }
.al-company > svg { width: 17px; height: 17px; color: var(--al-tx-3); }

.al-site .al-secure { margin-top: 1.4rem; }


/* =============================================================
   Tout tenir sur un seul écran (aucune barre de défilement)
   ============================================================= */
html:has(.al-body), .al-body { height: 100%; overflow: hidden; }
.al-shell { height: 100vh; height: 100dvh; min-height: 0; }
.al-intro, .al-panel { min-height: 0; height: 100%; }
.al-intro { padding-top: 2rem; padding-bottom: 2rem; }
.al-orbit { width: min(400px, 70%, 46vh); margin: auto auto 2.5rem; }
.al-intro-text h2 { font-size: clamp(1.4rem, 2.1vw, 1.9rem); }

.al-panel { padding-top: 1.25rem; padding-bottom: 1rem; overflow: hidden; }
.al-form-wrap { padding: .75rem 0; }
.al-tabs { margin-bottom: 1.1rem; }
.al-kicker { margin-bottom: .45rem; }
.al-form-wrap h1 { font-size: 1.7rem; margin-bottom: .3rem; }
.al-sub { margin-bottom: 1.2rem; }
.al-alert { margin-bottom: .9rem; padding: .6rem .85rem; }
.al-form { gap: .8rem; }
.al-field { gap: .35rem; }
.al-control { height: 44px; }
.al-submit { height: 44px; margin-top: .25rem; }
.al-divider { margin: .9rem 0 .75rem; }
.al-alt { height: 42px; }
.al-company { margin-top: .7rem; padding: .6rem .85rem; }
.al-company-ico { width: 34px; height: 34px; }
.al-secure { margin-top: 1rem; padding-top: .9rem; }
.al-site .al-secure { margin-top: 1rem; }

/* Écrans peu hauts : on resserre encore */
@media (max-height: 800px) {
    .al-form-wrap h1 { font-size: 1.5rem; }
    .al-sub { font-size: .85rem; margin-bottom: .9rem; }
    .al-tabs { margin-bottom: .8rem; }
    .al-tabs a { height: 34px; }
    .al-control, .al-submit { height: 40px; }
    .al-alt { height: 38px; }
    .al-form { gap: .6rem; }
    .al-divider { margin: .65rem 0 .55rem; }
    .al-hint { font-size: .72rem; }
}
@media (max-height: 700px) {
    .al-kicker, .al-secure { display: none; }
    .al-company { margin-top: .5rem; padding: .45rem .75rem; }
    .al-company-txt small { display: none; }
    .al-intro-text p { display: none; }
    .al-orbit { margin-bottom: 1.25rem; }
}

/* Mobile : une seule colonne, plein écran */
@media (max-width: 860px) {
    .al-shell { padding: 0; }
    .al-panel { border-radius: 0; min-height: 0; padding: 1rem 1.25rem .75rem; }
    .al-brand-mobile { margin-bottom: 1rem; }
    .al-brand-mobile img { width: 38px; height: 38px; }
}
@media (max-width: 860px) and (max-height: 860px) {
    .al-kicker, .al-secure { display: none; }
    .al-sub { margin-bottom: .8rem; }
    .al-company-txt small { display: none; }
}

/* Connexion travailleur : titre directement suivi du formulaire */
.al-site .al-form-wrap h1 { margin-bottom: 1.1rem; }
.al-site .al-form-wrap h1 + .al-sub { margin-top: -.75rem; }

/* Connexion travailleur : logo et titre centrés dans le panneau */
.al-site .al-intro > .al-brand { visibility: hidden; }
.al-site .al-brand-mobile { display: flex; width: max-content; margin: 0 auto 1.1rem; }
.al-site .al-brand-mobile img { width: 64px; height: 64px; }
.al-site .al-form-wrap h1 { text-align: center; }
@media (max-height: 760px) { .al-site .al-brand-mobile img { width: 48px; height: 48px; } .al-site .al-brand-mobile { margin-bottom: .7rem; } }

/* Mobile : le panneau occupe toute la hauteur (pas de bandes grises) */
@media (max-width: 860px) {
    .al-shell { grid-template-rows: 1fr; align-content: stretch; }
    .al-panel { height: 100%; }
}
@media (max-height: 640px) {
    .al-foot { display: none; }
    .al-site .al-brand-mobile img { width: 40px; height: 40px; }
    .al-site .al-brand-mobile { margin-bottom: .5rem; }
}
/* Écrans extrêmement bas (téléphone en paysage) : défilement interne plutôt que contenu coupé */
@media (max-height: 580px) { .al-panel { overflow-y: auto; } }
