/* =====================================================================
   CYNERGY URBAN MOBILITY - STYLES AUTHENTIFICATION (auth.css)
   =====================================================================
   Role : Style premium des pages publiques (login, mot de passe oublie,
          verification 2FA). Charge uniquement sur ces pages.
   ===================================================================== */
   
/* Reset box-sizing pour les pages d'authentification */
.cy-auth *,
.cy-auth *::before,
.cy-auth *::after {
    box-sizing: border-box;
}

.cy-auth {
    margin: 0;
}

body {
    margin: 0;
}

.cy-auth {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    width: 100%;
    min-height: 100vh;
}

/* ---------------------------------------------------------------------
   PANNEAU GAUCHE IMMERSIF
   --------------------------------------------------------------------- */
.cy-auth-visuel {
    position: relative;
    background:
        radial-gradient(circle at 30% 20%, rgba(232,115,26,0.18), transparent 45%),
        radial-gradient(circle at 75% 80%, rgba(192,57,43,0.14), transparent 50%),
        linear-gradient(155deg, #0A1F44 0%, #0D1B2A 100%);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 3.5rem;
    overflow: hidden;
}

/* Halo lumineux qui respire (signature) */
.cy-auth-halo {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 520px;
    height: 520px;
    transform: translate(-50%, -50%);
    background: radial-gradient(circle, rgba(232,115,26,0.22) 0%, transparent 65%);
    animation: cy-respiration 7s ease-in-out infinite;
    pointer-events: none;
}

@keyframes cy-respiration {
    0%, 100% { opacity: 0.5; transform: translate(-50%, -50%) scale(1); }
    50%      { opacity: 0.9; transform: translate(-50%, -50%) scale(1.12); }
}

.cy-auth-marque {
    position: relative;
    display: flex;
    align-items: center;
    opacity: 0;
    animation: cy-monte 0.7s var(--cy-ease, cubic-bezier(0.22,1,0.36,1)) 0.1s forwards;
}

.cy-marque-logo {
    height: 38px;
    width: auto;
    object-fit: contain;
}

.cy-auth-centre {
    position: relative;
    text-align: center;
    z-index: 1;
}

.cy-auth-bouclier {
    height: 88px;
    width: auto;
    object-fit: contain;
    margin-bottom: 2rem;
    filter: drop-shadow(0 18px 40px rgba(0,0,0,0.45));
    opacity: 0;
    animation: cy-monte 0.9s var(--cy-ease, cubic-bezier(0.22,1,0.36,1)) 0.25s forwards;
}

.cy-auth-slogan {
    font-family: 'Rajdhani', sans-serif;
    font-weight: 600;
    font-size: 2.4rem;
    line-height: 1.15;
    color: #fff;
    margin: 0 0 1rem;
    opacity: 0;
    animation: cy-monte 0.9s var(--cy-ease, cubic-bezier(0.22,1,0.36,1)) 0.4s forwards;
}
.cy-auth-slogan .accent { color: #E8731A; }

.cy-auth-desc {
    color: rgba(255,255,255,0.66);
    font-size: 1.02rem;
    max-width: 380px;
    margin: 0 auto;
    line-height: 1.6;
    opacity: 0;
    animation: cy-monte 0.9s var(--cy-ease, cubic-bezier(0.22,1,0.36,1)) 0.55s forwards;
}

.cy-auth-atouts {
    position: relative;
    display: flex;
    gap: 1.75rem;
    flex-wrap: wrap;
    opacity: 0;
    animation: cy-monte 0.9s var(--cy-ease, cubic-bezier(0.22,1,0.36,1)) 0.7s forwards;
}
.cy-atout { display: flex; align-items: center; gap: 0.6rem; }
.cy-atout i {
    color: #E8731A;
    font-size: 1.05rem;
    width: 34px; height: 34px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.08);
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.18);
}
.cy-atout span { color: rgba(255,255,255,0.82); font-size: 0.86rem; font-weight: 500; }

/* ---------------------------------------------------------------------
   PANNEAU DROIT : FORMULAIRE
   --------------------------------------------------------------------- */
.cy-auth-form {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2.5rem;
    background: #EEF1F6;
}

.cy-carte-login {
    width: 100%;
    max-width: 410px;
    opacity: 0;
    animation: cy-monte 0.8s var(--cy-ease, cubic-bezier(0.22,1,0.36,1)) 0.35s forwards;
}

.cy-login-titre {
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    font-size: 2rem;
    color: #16233B;
    margin: 0 0 0.35rem;
}

.cy-login-intro {
    color: #6B7A90;
    font-size: 0.95rem;
    margin: 0 0 2.25rem;
}

.cy-auth-champ { margin-bottom: 1.35rem; }

.cy-auth-label {
    display: block;
    font-weight: 600;
    font-size: 0.83rem;
    margin-bottom: 0.5rem;
    color: #16233B;
}

.cy-auth-input-wrap { position: relative; }

.cy-auth-input-wrap > .icone-g {
    position: absolute;
    left: 1rem; top: 50%;
    transform: translateY(-50%);
    color: #6B7A90;
    font-size: 0.95rem;
    transition: color 0.25s var(--cy-ease, cubic-bezier(0.22,1,0.36,1));
}

.cy-auth-input {
    width: 100%;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.95rem;
    color: #16233B;
    background: #F7F9FC;
    border: 1.5px solid #E4E9F0;
    border-radius: 14px;
    padding: 0.95rem 1rem 0.95rem 2.85rem;
    transition: border-color 0.25s, box-shadow 0.25s, background 0.25s;
}
.cy-auth-input::placeholder { color: #aab4c5; }
.cy-auth-input:focus {
    outline: none;
    background: #fff;
    border-color: #E8731A;
    box-shadow: 0 0 0 4px rgba(232,115,26,0.12);
}
.cy-auth-input-wrap:focus-within > .icone-g { color: #E8731A; }

.cy-auth-input-wrap .icone-d {
    position: absolute;
    right: 0.4rem; top: 50%;
    transform: translateY(-50%);
    background: none; border: none;
    color: #6B7A90;
    cursor: pointer;
    padding: 0.6rem;
    font-size: 1rem;
    transition: color 0.25s;
}
.cy-auth-input-wrap .icone-d:hover { color: #E8731A; }

.cy-auth-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.75rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.cy-auth-check { display: inline-flex; align-items: center; gap: 0.5rem; font-size: 0.85rem; color: #6B7A90; cursor: pointer; }
.cy-auth-check input { width: 17px; height: 17px; accent-color: #E8731A; cursor: pointer; }
.cy-auth-lien { font-size: 0.85rem; font-weight: 600; color: #E8731A; text-decoration: none; transition: color 0.2s; }
.cy-auth-lien:hover { color: #f59042; }

.cy-auth-btn {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    font-family: 'Rajdhani', sans-serif;
    font-weight: 600;
    font-size: 1.05rem;
    letter-spacing: 0.02em;
    color: #fff;
    background: linear-gradient(135deg, #E8731A 0%, #d1640f 100%);
    border: none;
    border-radius: 14px;
    padding: 1rem;
    cursor: pointer;
    box-shadow: 0 10px 25px -8px rgba(232,115,26,0.55);
    transition: transform 0.2s, box-shadow 0.25s;
}
.cy-auth-btn:hover { transform: translateY(-2px); box-shadow: 0 16px 32px -8px rgba(232,115,26,0.6); }
.cy-auth-btn:active { transform: translateY(0) scale(0.99); }
.cy-auth-btn:disabled { opacity: 0.7; cursor: not-allowed; transform: none; }

.cy-auth-sep {
    display: flex; align-items: center;
    text-align: center;
    margin: 1.6rem 0;
    color: #6B7A90;
    font-size: 0.82rem;
}
.cy-auth-sep::before, .cy-auth-sep::after {
    content: ''; flex: 1; height: 1px; background: #E4E9F0;
}
.cy-auth-sep span { padding: 0 1rem; }

.cy-auth-google {
    width: 100%;
    display: inline-flex; align-items: center; justify-content: center; gap: 0.7rem;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-weight: 600; font-size: 0.95rem;
    color: #16233B;
    background: #fff;
    border: 1.5px solid #E4E9F0;
    border-radius: 14px;
    padding: 0.9rem;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s, border-color 0.2s;
}
.cy-auth-google:hover { background: #F7F9FC; border-color: #d4dbe6; color: #16233B; }
.cy-auth-google .fa-google { color: #4285F4; }

.cy-auth-pied {
    text-align: center;
    margin-top: 2rem;
    font-size: 0.82rem;
    color: #6B7A90;
}

/* Alertes (erreurs / info) sur les pages d'auth */
.cy-auth-alerte {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    padding: 0.85rem 1rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    font-size: 0.88rem;
    border-left: 4px solid #6B7A90;
}
.cy-auth-alerte i { font-size: 1.05rem; margin-top: 1px; flex-shrink: 0; }
.cy-auth-alerte p { margin: 0; }
.cy-auth-alerte-danger { background: rgba(231,76,60,0.08); border-left-color: #E74C3C; color: #16233B; }
.cy-auth-alerte-danger i { color: #E74C3C; }
.cy-auth-alerte-info { background: rgba(10,31,68,0.06); border-left-color: #0A1F44; color: #16233B; }
.cy-auth-alerte-info i { color: #0A1F44; }

/* Logo mobile (visible uniquement sur petit ecran) */
.cy-mobile-logo { display: none; justify-content: center; margin-bottom: 1.75rem; }
.cy-mobile-logo img { width: 150px; }

/* Animation d'apparition */
@keyframes cy-monte {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ---------------------------------------------------------------------
   RESPONSIVE
   --------------------------------------------------------------------- */
@media (max-width: 900px) {
    .cy-auth { grid-template-columns: 1fr; }
    .cy-auth-visuel { display: none; }
    .cy-auth-form { padding: 1.5rem; min-height: 100vh; }
    .cy-carte-login {
        background: #fff;
        border-radius: 24px;
        padding: 2.25rem 1.75rem;
        box-shadow: 0 20px 60px -15px rgba(10,31,68,0.18);
    }
    .cy-mobile-logo { display: flex; }
}

@media (prefers-reduced-motion: reduce) {
    .cy-auth-halo,
    .cy-auth-marque,
    .cy-auth-bouclier,
    .cy-auth-slogan,
    .cy-auth-desc,
    .cy-auth-atouts,
    .cy-carte-login {
        animation: none !important;
        opacity: 1 !important;
    }
}

/* Honeypot : invisible pour l'humain, accessible aux robots */
.cy-hp {
    position: absolute;
    left: -9999px;
    top: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* Masquer le badge reCAPTCHA (mention legale affichee a la place) */
.grecaptcha-badge {
    visibility: hidden;
}

/* Mention legale reCAPTCHA */
.cy-auth-recaptcha-mention {
    text-align: center;
    margin-top: 0.75rem;
    font-size: 0.72rem;
    line-height: 1.5;
    color: #9aa6b8;
}
.cy-auth-recaptcha-mention a {
    color: #6B7A90;
    text-decoration: underline;
    transition: color 0.2s;
}
.cy-auth-recaptcha-mention a:hover {
    color: #E8731A;
}

.cy-code-input {
    text-align: center;
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.5rem;
    letter-spacing: 0.5rem;
}

/* Texte sous la barre de force du mot de passe */
.cy-force-barre {
    height: 6px;
    border-radius: 999px;
    background-color: #E4E9F0;
    overflow: hidden;
    margin-top: 0.6rem;
}
.cy-force-niveau {
    height: 100%;
    width: 0;
    border-radius: 999px;
    transition: width 0.3s, background-color 0.3s;
}
.cy-force-faible { width: 33%; background-color: #E74C3C; }
.cy-force-moyen  { width: 66%; background-color: #F39C12; }
.cy-force-fort   { width: 100%; background-color: #27AE60; }
.cy-force-texte {
    display: block;
    margin-top: 0.4rem;
    font-size: 0.78rem;
    font-weight: 600;
}

/* =====================================================================
   Bouton de connexion biometrique (WebAuthn)
   ===================================================================== */
.cy-auth-btn-biometrie {
    margin-top: 0.75rem;
    background: transparent;
    color: #0A1F44;
    border: 1px solid #0A1F44;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.cy-auth-btn-biometrie:hover {
    background: #0A1F44;
    color: #ffffff;
}

.cy-auth-btn-biometrie i {
    font-size: 1.1rem;
}

/* Mode sombre : adapte les couleurs au theme inverse. */
html[data-theme="sombre"] .cy-auth-btn-biometrie {
    color: #ffffff;
    border-color: #ffffff;
}

html[data-theme="sombre"] .cy-auth-btn-biometrie:hover {
    background: #ffffff;
    color: #0A1F44;
}

/* =====================================================================
   Utilitaire : affichage sur mobile uniquement (bouton biometrie login)
   ---------------------------------------------------------------------
   Masque par defaut. N'affiche l'element que sur un appareil reellement
   tactile (pointer: coarse) ET dont l'ecran est etroit (<= 768px).
   ===================================================================== */
.cy-mobile-only {
    display: none !important;
}

@media (max-width: 768px) and (pointer: coarse) {
    .cy-mobile-only {
        display: flex !important;
    }
}

/* =====================================================================
   THEME SOMBRE (surcharges) + BOUTON BASCULE
   Le panneau gauche immersif reste sombre dans les deux themes.
   ===================================================================== */

/* Bouton bascule : ancre dans la carte de connexion */
.cy-carte-login { position: relative; }
.cy-theme-btn {
    position: absolute; top: 0; right: 0; z-index: 5;
    display: inline-flex; align-items: center; justify-content: center;
    width: 42px; height: 42px; border-radius: 50%;
    border: 1.5px solid #E4E9F0;
    background: #ffffff; color: #16233B;
    font-size: 1rem; cursor: pointer;
    box-shadow: 0 4px 14px -6px rgba(22,35,59,0.25);
    transition: color 0.2s, border-color 0.2s, transform 0.2s;
}
.cy-theme-btn:hover { color: #E8731A; border-color: #E8731A; transform: translateY(-2px); }
.cy-theme-btn .ic-clair { display: none; }
html[data-theme="sombre"] .cy-theme-btn {
    border-color: rgba(255,255,255,0.22);
    background: rgba(255,255,255,0.08); color: #ffffff;
    box-shadow: none;
}
html[data-theme="sombre"] .cy-theme-btn .ic-sombre { display: none; }
html[data-theme="sombre"] .cy-theme-btn .ic-clair { display: inline-block; }
@media (max-width: 900px) {
    .cy-theme-btn { top: 1.1rem; right: 1.1rem; }
}

/* Logos mobiles selon le theme */
.cy-mlogo-sombre { display: none; }
html[data-theme="sombre"] .cy-mobile-logo .cy-mlogo-clair { display: none; }
html[data-theme="sombre"] .cy-mobile-logo .cy-mlogo-sombre { display: block; }

/* Panneau formulaire en sombre */
html[data-theme="sombre"] .cy-auth-form {
    background: linear-gradient(160deg, #0A1F44 0%, #0D1B2A 100%);
}
html[data-theme="sombre"] .cy-login-titre,
html[data-theme="sombre"] .cy-auth-label { color: #ffffff; }
html[data-theme="sombre"] .cy-login-intro,
html[data-theme="sombre"] .cy-auth-check,
html[data-theme="sombre"] .cy-auth-pied,
html[data-theme="sombre"] .cy-auth-sep { color: #94A3B8; }
html[data-theme="sombre"] .cy-auth-sep::before,
html[data-theme="sombre"] .cy-auth-sep::after { background: rgba(255,255,255,0.15); }
html[data-theme="sombre"] .cy-auth-input {
    background: #071633; border-color: rgba(255,255,255,0.15); color: #ffffff;
}
html[data-theme="sombre"] .cy-auth-input::placeholder { color: rgba(255,255,255,0.40); }
html[data-theme="sombre"] .cy-auth-input:focus { background: #0A1F44; }
html[data-theme="sombre"] .cy-auth-google {
    background: #112854; border-color: rgba(255,255,255,0.15); color: #ffffff;
}
html[data-theme="sombre"] .cy-auth-google:hover { background: #0A1F44; }
html[data-theme="sombre"] .cy-auth-alerte-danger { color: #F8FAFC; }
html[data-theme="sombre"] .cy-auth-alerte-info {
    background: rgba(255,255,255,0.06); border-left-color: #4C8CFF; color: #F8FAFC;
}
html[data-theme="sombre"] .cy-auth-alerte-info i { color: #4C8CFF; }
html[data-theme="sombre"] .cy-auth-recaptcha-mention { color: #6B7A90; }
html[data-theme="sombre"] .cy-auth-recaptcha-mention a { color: #94A3B8; }
@media (max-width: 900px) {
    html[data-theme="sombre"] .cy-carte-login {
        background: #112854;
        box-shadow: 0 20px 60px -15px rgba(0,0,0,0.5);
    }
}

/* ===== LOGOS CLIQUABLES (retour au site vitrine) ===== */
.cy-marque-lien { display: inline-flex; }
.cy-marque-lien:hover .cy-marque-logo,
.cy-mobile-logo a:hover img { opacity: 0.8; }
.cy-marque-logo, .cy-mobile-logo img { transition: opacity 0.2s; }

.cy-2fa-alt { text-align: center; margin: 1.25rem 0; }
.cy-2fa-aide { font-size: 0.82rem; color: var(--cy-neutre); margin-top: 0.4rem; }