/* ==========================================================================
   MYSUNCOM - AUTHENTICATION (EFFET GLACE CRISTAL & FILIGRANE FLUIDE 360°)
   Carte Glace Translucide • Rotation 3D • Filigrane MySunCom Animé en Fond
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Outfit:wght@600;700;800;900&family=JetBrains+Mono:wght@600;700&display=swap');

:root {
    --gold-primary: #E5A910;
    --gold-bright: #FBBF24;
    --gold-dark: #9A6700;
    --gold-light: rgba(254, 243, 199, 0.85);
    --slate-900: #0F172A;
    --slate-800: #1E293B;
    --slate-700: #334155;
    --slate-600: #475569;
    --white: #FFFFFF;

    --font-heading: 'Outfit', sans-serif;
    --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html,
body {
    height: 100%;
}

body.auth-body {
    font-family: var(--font-sans);
    color: var(--slate-900);
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow-x: hidden;
    overflow-y: auto;
    scrollbar-width: none;
    padding: 20px 16px;
    -webkit-font-smoothing: antialiased;
}

body.auth-body::-webkit-scrollbar {
    display: none;
}

/* ==========================================================================
   ARRIÈRE-PLAN : IMAGE NETTE + SUPERPOSITION DE COULEURS + FILIGRANE FLUIDE
   ========================================================================== */
.auth-scene-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.auth-scene-image {
    position: absolute;
    inset: 0;
    background: url('../../images/2241.jpg') center center / cover no-repeat;
    transform: scale(1.03);
    animation: bgBreath 18s ease-in-out infinite alternate;
}

@keyframes bgBreath {
    0% {
        transform: scale(1.02) translate(0, 0);
    }

    100% {
        transform: scale(1.08) translate(-10px, -8px);
    }
}

.auth-scene-overlay {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 20% 25%, rgba(229, 169, 16, 0.45) 0%, transparent 55%),
        radial-gradient(circle at 80% 75%, rgba(245, 158, 11, 0.38) 0%, transparent 55%),
        linear-gradient(135deg, rgba(15, 23, 42, 0.64) 0%, rgba(30, 41, 59, 0.46) 50%, rgba(15, 23, 42, 0.68) 100%);
}

/* ==========================================================================
   FILIGRANE DYNAMIQUE "MySunCom" : BELLE TAILLE & MOUVEMENT FLUIDE 360°
   Piloté à 60 FPS avec répulsion magnétique anti-collision (zéro chevauchement).
   ========================================================================== */
.auth-watermark-stage {
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    overflow: hidden;
}

.auth-watermark-item {
    position: absolute;
    top: 0;
    left: 0;
    font-family: var(--font-heading);
    font-size: clamp(2.35rem, 3.8vw, 3.35rem);
    font-weight: 900;
    letter-spacing: 0.06em;
    white-space: nowrap;
    user-select: none;
    line-height: 1;
    color: rgba(255, 255, 255, 0.22);
    -webkit-text-stroke: 1.2px rgba(255, 255, 255, 0.42);
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.14);
    will-change: transform;
}

.auth-watermark-item .wm-sun {
    color: rgba(251, 191, 36, 0.42);
    -webkit-text-stroke: 1.2px rgba(251, 191, 36, 0.68);
}

/* ==========================================================================
   CONTENEUR 3D COMPACT & ROTATION FLUIDE
   ========================================================================== */
.auth-viewport-3d {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 400px;
    perspective: 1300px;
    margin: auto;
}

.auth-card-3d {
    position: relative;
    width: 100%;
    transform-style: preserve-3d;
    transition: transform 0.78s cubic-bezier(0.34, 1.25, 0.64, 1);
}

.auth-card-3d.flipped {
    transform: rotateY(180deg);
}

/* ==========================================================================
   EFFET "GLACE" (CRYSTAL ICE / VERRE GLACÉ TRANSLUCIDE & RÉFRACTION)
   ========================================================================== */
.auth-card-face {
    width: 100%;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    border-radius: 24px;
    background: linear-gradient(135deg,
            rgba(255, 255, 255, 0.52) 0%,
            rgba(255, 255, 255, 0.28) 50%,
            rgba(255, 255, 255, 0.42) 100%);
    backdrop-filter: blur(22px) saturate(190%);
    -webkit-backdrop-filter: blur(22px) saturate(190%);
    border: 1.5px solid rgba(255, 255, 255, 0.72);
    box-shadow:
        0 25px 55px -12px rgba(0, 0, 0, 0.38),
        inset 0 1px 3px rgba(255, 255, 255, 0.95),
        inset 0 -1px 2px rgba(255, 255, 255, 0.4),
        0 0 25px rgba(229, 169, 16, 0.18);
    padding: 28px 28px 24px;
    position: relative;
    overflow: hidden;
}

/* Reflet diagonal de glace (sheen optique) */
.auth-card-face::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(125deg,
            rgba(255, 255, 255, 0.45) 0%,
            rgba(255, 255, 255, 0.12) 32%,
            transparent 45%,
            transparent 100%);
    pointer-events: none;
    z-index: 0;
}

/* Liseré supérieur doré lumineux */
.auth-card-face::before {
    content: '';
    position: absolute;
    top: 0;
    left: 24px;
    right: 24px;
    height: 3.5px;
    border-radius: 0 0 4px 4px;
    background: linear-gradient(90deg, #FBBF24 0%, #E5A910 50%, #B45309 100%);
    z-index: 3;
}

.auth-card-face>* {
    position: relative;
    z-index: 2;
}

.auth-card-face-front {
    position: relative;
    z-index: 2;
}

.auth-card-face-back {
    position: absolute;
    top: 0;
    left: 0;
    transform: rotateY(180deg);
}

.auth-card-3d.flipped .auth-card-face-front {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
}

.auth-card-3d.flipped .auth-card-face-back {
    position: relative;
    z-index: 2;
}

/* ==========================================================================
   EN-TÊTE COMPACT : LOGO MYSUNCOM + SÉLECTEUR COULISSANT GLACÉ
   ========================================================================== */
.auth-card-header {
    text-align: center;
    margin-bottom: 20px;
}

.auth-brand-inline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-decoration: none;
    margin-bottom: 16px;
    transition: transform 0.2s ease;
}

.auth-brand-inline:hover {
    transform: scale(1.03);
}

.auth-brand-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.92);
    border: 2px solid var(--gold-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(229, 169, 16, 0.3);
    overflow: hidden;
}

.auth-brand-circle img {
    width: 27px;
    height: auto;
    object-fit: contain;
}

.auth-brand-name {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--slate-900);
    letter-spacing: -0.02em;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
}

.auth-brand-name span {
    color: var(--gold-dark);
}

/* Sélecteur d'onglets [ Connexion | Inscription ] effet glace */
.auth-toggle-pill-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    background: rgba(255, 255, 255, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.75);
    box-shadow: inset 0 1px 3px rgba(15, 23, 42, 0.08);
    border-radius: 12px;
    padding: 4px;
}

.auth-toggle-pill-btn {
    border: none;
    background: transparent;
    color: var(--slate-800);
    font-family: var(--font-sans);
    font-size: 0.86rem;
    font-weight: 700;
    padding: 8px 12px;
    border-radius: 9px;
    cursor: pointer;
    transition: all 0.25s ease;
}

.auth-toggle-pill-btn.active {
    color: var(--slate-900);
    background: linear-gradient(135deg, #FBBF24 0%, #E5A910 100%);
    box-shadow: 0 3px 10px rgba(229, 169, 16, 0.4);
}

.auth-toggle-pill-btn:not(.active):hover {
    background: rgba(255, 255, 255, 0.4);
}

/* ==========================================================================
   ALERTES (ERREUR / SUCCÈS)
   ========================================================================== */
.auth-feedback-banner {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 0.82rem;
    font-weight: 600;
    line-height: 1.35;
    margin-bottom: 14px;
    backdrop-filter: blur(8px);
}

.auth-feedback-error {
    background: rgba(254, 242, 242, 0.88);
    border: 1px solid rgba(252, 165, 165, 0.9);
    color: #991B1B;
}

.auth-feedback-error svg {
    width: 16px;
    height: 16px;
    color: #DC2626;
    flex-shrink: 0;
}

.auth-feedback-success {
    background: rgba(236, 253, 245, 0.88);
    border: 1px solid rgba(167, 243, 208, 0.9);
    color: #065F46;
}

.auth-feedback-success svg {
    width: 16px;
    height: 16px;
    color: #10B981;
    flex-shrink: 0;
}

/* ==========================================================================
   CHAMPS DE FORMULAIRE CRISTAL GLACÉ
   ========================================================================== */
.auth-form-stack {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.auth-input-field {
    position: relative;
}

.auth-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.auth-input-icon {
    position: absolute;
    left: 14px;
    width: 17px;
    height: 17px;
    color: var(--slate-600);
    pointer-events: none;
    transition: color 0.2s ease;
    z-index: 2;
}

.auth-control-input {
    width: 100%;
    height: 45px;
    background: rgba(255, 255, 255, 0.65);
    border: 1.5px solid rgba(255, 255, 255, 0.85);
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.06);
    border-radius: 12px;
    padding: 0 40px 0 40px;
    font-family: var(--font-sans);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--slate-900);
    transition: all 0.2s ease;
    outline: none;
}

.auth-control-input::placeholder {
    color: var(--slate-600);
    font-weight: 500;
}

.auth-control-input:focus {
    background: rgba(255, 255, 255, 0.92);
    border-color: var(--gold-primary);
    box-shadow: 0 0 0 3.5px rgba(229, 169, 16, 0.22);
}

.auth-input-wrapper:focus-within .auth-input-icon {
    color: var(--gold-dark);
}

/* Bouton œil mot de passe */
.auth-eye-toggle {
    position: absolute;
    right: 11px;
    background: transparent;
    border: none;
    color: var(--slate-600);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: color 0.2s ease;
}

.auth-eye-toggle:hover {
    color: var(--slate-900);
}

.auth-eye-toggle svg {
    width: 17px;
    height: 17px;
}

/* Chip de parrainage */
.auth-referral-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 5px 10px;
    border-radius: 8px;
    background: var(--gold-light);
    border: 1px solid #FDE68A;
    font-size: 0.76rem;
    font-weight: 700;
    color: #92400E;
}

.auth-referral-chip svg {
    width: 14px;
    height: 14px;
}

/* ==========================================================================
   BOUTON PRINCIPAL
   ========================================================================== */
.auth-submit-btn {
    width: 100%;
    height: 46px;
    margin-top: 4px;
    background: linear-gradient(135deg, #FBBF24 0%, #E5A910 55%, #CA8A04 100%);
    color: var(--slate-900);
    font-family: var(--font-heading);
    font-size: 0.96rem;
    font-weight: 800;
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 12px;
    cursor: pointer;
    box-shadow: 0 8px 20px -4px rgba(229, 169, 16, 0.5);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.25s ease;
}

.auth-submit-btn:hover {
    transform: translateY(-1.5px);
    box-shadow: 0 12px 24px -4px rgba(229, 169, 16, 0.65);
}

.auth-submit-btn:active {
    transform: translateY(0);
}

.auth-submit-btn svg {
    width: 16px;
    height: 16px;
    transition: transform 0.2s ease;
}

.auth-submit-btn:hover svg {
    transform: translateX(3px);
}

/* ==========================================================================
   PIED DE CARTE : BASCULEMENT RAPIDE
   ========================================================================== */
.auth-card-footer {
    text-align: center;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.55);
}

.auth-switch-text {
    font-size: 0.83rem;
    color: var(--slate-800);
    font-weight: 600;
}

.auth-flip-trigger-btn {
    background: transparent;
    border: none;
    color: var(--gold-dark);
    font-family: var(--font-sans);
    font-size: 0.83rem;
    font-weight: 800;
    cursor: pointer;
    margin-left: 4px;
    transition: color 0.2s ease;
}

.auth-flip-trigger-btn:hover {
    color: var(--slate-900);
    text-decoration: underline;
}

/* ==========================================================================
   ÉTAPE 2 : VÉRIFICATION CODE OTP 6 CHIFFRES
   ========================================================================== */
.auth-otp-target-email {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 999px;
    background: var(--gold-light);
    color: #92400E;
    font-size: 0.8rem;
    font-weight: 700;
    margin: 6px 0 12px;
}

.auth-otp-input-field {
    text-align: center;
    margin: 8px 0 12px;
}

.auth-otp-control {
    width: 100%;
    max-width: 240px;
    margin: 0 auto;
    font-family: var(--font-mono);
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: 0.35em;
    text-align: center;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.75);
    border: 2px solid var(--gold-primary);
    border-radius: 12px;
    color: var(--slate-900);
    outline: none;
    transition: all 0.25s ease;
}

.auth-otp-control:focus {
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 0 0 4px rgba(229, 169, 16, 0.25);
}

.auth-otp-control.is-verifying {
    border-color: #10B981;
    background: rgba(236, 253, 245, 0.9);
    color: #065F46;
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.2);
    pointer-events: none;
}

.auth-otp-auto-status {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 28px;
    font-size: 0.81rem;
    font-weight: 700;
    color: var(--slate-700);
    margin-top: 2px;
}

.auth-otp-auto-status.loading {
    display: flex;
    color: var(--gold-dark);
}

.auth-otp-spinner {
    width: 16px;
    height: 16px;
    border: 2.5px solid rgba(229, 169, 16, 0.28);
    border-top-color: var(--gold-primary);
    border-radius: 50%;
    animation: otpSpin 0.65s linear infinite;
    display: none;
}

.auth-otp-auto-status.loading .auth-otp-spinner {
    display: inline-block;
}

@keyframes otpSpin {
    to {
        transform: rotate(360deg);
    }
}

.auth-otp-resend-link {
    color: var(--gold-dark);
    font-size: 0.82rem;
    font-weight: 800;
    text-decoration: none;
    margin-left: 4px;
}

.auth-otp-resend-link:hover {
    color: var(--slate-900);
    text-decoration: underline;
}

/* Lien Mot de passe oublié */
.auth-forgot-row {
    display: flex;
    justify-content: flex-end;
    margin-top: -4px;
    margin-bottom: 2px;
}

.auth-forgot-link {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--slate-700);
    text-decoration: none;
    transition: color 0.2s ease;
}

.auth-forgot-link:hover {
    color: var(--gold-dark);
    text-decoration: underline;
}

/* Titre secondaire & indicateur d'étapes (Mot de passe oublié / OTP 2FA) */
.auth-sub-headline {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--slate-900);
    margin: 4px 0 6px;
}

.auth-step-dots {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-bottom: 10px;
}

.auth-step-dots .step-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.65);
    border: 1.5px solid var(--slate-600);
    transition: all 0.25s ease;
}

.auth-step-dots .step-dot.active {
    background: var(--gold-primary);
    border-color: var(--gold-dark);
    box-shadow: 0 0 8px rgba(229, 169, 16, 0.5);
    transform: scale(1.15);
}

.auth-step-dots .step-line {
    width: 24px;
    height: 2px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 2px;
}

.auth-step-dots .step-line.active {
    background: var(--gold-primary);
}

@media (max-width: 1024px) {

    html,
    body,
    * {
        scrollbar-width: none !important;
        -ms-overflow-style: none !important;
    }

    html::-webkit-scrollbar,
    body::-webkit-scrollbar,
    *::-webkit-scrollbar {
        display: none !important;
        width: 0 !important;
        height: 0 !important;
    }
}

@media (max-width: 640px) {
    body.auth-body {
        padding: 14px 12px;
        overflow-y: auto;
        overflow-x: hidden;
    }

    .auth-watermark-item {
        font-size: clamp(1.35rem, 5.2vw, 2.1rem);
    }

    .auth-viewport-3d {
        max-width: 360px;
    }

    .auth-card-face {
        padding: 20px 18px 18px;
        border-radius: 20px;
    }

    .auth-brand-circle {
        width: 34px;
        height: 34px;
    }

    .auth-brand-circle img {
        width: 23px;
    }

    .auth-brand-name {
        font-size: 1.22rem;
    }

    .auth-toggle-pill-btn {
        font-size: 0.8rem;
        padding: 7px 10px;
    }

    .auth-control-input {
        height: 41px;
        font-size: 0.84rem;
    }

    .auth-submit-btn {
        height: 42px;
        font-size: 0.88rem;
    }
}


/* ==========================================================================
   BOUTON OAUTH GOOGLE (CONNEXION & INSCRIPTION)
   ========================================================================== */
.auth-oauth-divider {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 12px 0 10px;
    color: var(--slate-600);
    font-size: 0.76rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.auth-oauth-divider::before,
.auth-oauth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(15, 23, 42, 0.14);
}
.auth-google-btn {
    width: 100%;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.92);
    border: 1.5px solid rgba(15, 23, 42, 0.12);
    color: #0F172A;
    font-family: var(--font-sans);
    font-size: 0.88rem;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
    transition: all 0.2s ease;
}
.auth-google-btn:hover {
    background: #FFFFFF;
    border-color: rgba(229, 169, 16, 0.65);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.12);
}
.auth-google-btn svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}


/* Case d'acceptation légale (Conditions & Confidentialité) */
.auth-legal-check {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 0.76rem;
    line-height: 1.4;
    color: var(--slate-700, #334155);
    cursor: pointer;
    margin: 2px 0;
}
.auth-legal-check input[type="checkbox"] {
    width: 15px;
    height: 15px;
    margin-top: 2px;
    accent-color: #D97706;
    flex-shrink: 0;
    cursor: pointer;
}
.auth-legal-check a {
    color: #B45309;
    font-weight: 700;
    text-decoration: underline;
}
.auth-legal-check a:hover {
    color: #92400E;
}
