/* ==========================================
   FICHIER : /css/pages/auth.css
   PROJET  : Divine Hair Secrets by Lionne
   Dépend de : main.css (variables, polices, reset)
   Logique JS : auth.js (inchangée)
========================================== */


/* ─────────────────────────────────────
   1. LAYOUT GÉNÉRAL
───────────────────────────────────── */
.auth-page {
    min-height: 100vh;
    background: var(--beige-100);
    display: flex;
    align-items: stretch;
    padding: 0;
}

/* Conteneur 2 colonnes */
.auth-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
    min-height: 100vh;
}


/* ─────────────────────────────────────
   2. PANNEAU GAUCHE DÉCORATIF
───────────────────────────────────── */
.auth-deco {
    background: linear-gradient(145deg,
        var(--green-900) 0%,
        var(--green-800) 55%,
        var(--brown-900) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 48px;
    position: relative;
    overflow: hidden;
}

.auth-deco::before {
    content: '';
    position: absolute; inset: 0;
    background: radial-gradient(ellipse at 70% 40%,
        rgba(197,160,89,.14) 0%, transparent 65%);
    pointer-events: none;
}

.auth-deco-inner {
    position: relative;
    text-align: center;
    max-width: 320px;
}

.auth-deco-logo {
    width: 90px; height: 90px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid rgba(255,255,255,.2);
    margin: 0 auto 24px;
    display: block;
    box-shadow: 0 8px 24px rgba(0,0,0,.2);
}

.auth-deco-title {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 800;
    color: #fff;
    line-height: 1.15;
    letter-spacing: -.02em;
    margin-bottom: 16px;
}

.auth-deco-tagline {
    font-family: var(--font-body);
    font-size: .92rem;
    font-weight: 300;
    font-style: italic;
    color: rgba(255,255,255,.65);
    line-height: 1.7;
    margin-bottom: 36px;
}

.auth-deco-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
}

.auth-deco-dots span {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: rgba(255,255,255,.25);
}

.auth-deco-dots span:first-child {
    background: var(--gold-500);
    width: 24px;
    border-radius: 4px;
}


/* ─────────────────────────────────────
   3. PANNEAU DROIT (FORMULAIRE)
───────────────────────────────────── */
.auth-panel {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 60px 52px;
    background: #fff;
    overflow-y: auto;
}

/* Logo mobile — masqué sur desktop */
.auth-logo-mobile {
    display: none;
    margin: 0 auto 32px;
}

.auth-logo-mobile img {
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(22,53,40,.12);
}


/* ─────────────────────────────────────
   4. TOGGLE CONNEXION / INSCRIPTION
   Logique identique à l'original
───────────────────────────────────── */
.auth-toggle {
    display: flex;
    background: var(--beige-100);
    padding: 5px;
    border-radius: 50px;
    position: relative;
    margin-bottom: 36px;
    border: 1px solid rgba(22,53,40,.07);
}

.toggle-slider {
    position: absolute;
    width: calc(50% - 5px);
    height: calc(100% - 10px);
    background: var(--white);
    border-radius: 50px;
    box-shadow: 0 3px 10px rgba(22,53,40,.08);
    transition: transform .3s cubic-bezier(.4,0,.2,1);
}

.toggle-btn {
    flex: 1;
    border: none;
    background: none;
    padding: 11px 16px;
    font-family: var(--font-heading);
    font-size: .85rem;
    font-weight: 700;
    color: var(--brown-500);
    cursor: pointer;
    position: relative;
    z-index: 1;
    transition: color .25s;
    letter-spacing: .02em;
}

.toggle-btn.active { color: var(--green-900); }


/* ─────────────────────────────────────
   5. FORMULAIRES
───────────────────────────────────── */
.auth-form {
    display: none;
    animation: authFadeIn .35s ease;
}

.auth-form.active { display: block; }

@keyframes authFadeIn {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: none; }
}

.auth-form-header {
    margin-bottom: 28px;
}

.auth-form-header h2 {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--green-950);
    margin-bottom: 6px;
    letter-spacing: -.01em;
}

.auth-form-header p {
    font-family: var(--font-body);
    font-size: .88rem;
    color: var(--brown-500);
    line-height: 1.5;
}


/* ─────────────────────────────────────
   6. CHAMPS
───────────────────────────────────── */
.input-group {
    margin-bottom: 18px;
}

.input-group label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-heading);
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--brown-500);
    margin-bottom: 8px;
}

.input-group label .material-icons-round {
    font-size: .95rem;
    color: var(--green-900);
    opacity: .6;
}

.input-group input {
    width: 100%;
    padding: 13px 16px;
    font-family: var(--font-body);
    font-size: .92rem;
    color: var(--brown-900);
    background: var(--beige-100);
    border: 1.5px solid rgba(22,53,40,.1);
    border-radius: var(--radius-sm);
    outline: none;
    transition: var(--transition-fast);
}

.input-group input:focus {
    border-color: var(--green-900);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(22,53,40,.06);
}

.input-group input::placeholder { color: #ccc; }

/* Wrapper mot de passe */
.password-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-wrapper input {
    padding-right: 46px !important;
}

.toggle-password {
    position: absolute; right: 14px;
    top: 50%; transform: translateY(-50%);
    font-size: 1.1rem !important;
    color: var(--brown-500);
    cursor: pointer;
    user-select: none;
    transition: color .2s;
    z-index: 2;
}

.toggle-password:hover { color: var(--green-900); }


/* ─────────────────────────────────────
   7. BOUTON PRINCIPAL
───────────────────────────────────── */
.btn-auth-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px;
    font-family: var(--font-heading);
    font-size: .9rem;
    font-weight: 700;
    letter-spacing: .02em;
    color: #fff;
    background: var(--green-900);
    border: none;
    border-radius: var(--radius-lg);
    cursor: pointer;
    margin-top: 8px;
    transition: var(--transition-fast);
}

.btn-auth-submit:hover {
    background: var(--gold-500);
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(197,160,89,.3);
}

.btn-auth-submit .material-icons-round { font-size: 1.1rem; }

/* Lien mot de passe oublié */
.forgot-link {
    display: block;
    width: 100%;
    text-align: right;
    font-family: var(--font-body);
    font-size: .84rem;
    font-weight: 600;
    color: var(--gold-500);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    margin-bottom: 18px;
    transition: color .2s;
}

.forgot-link:hover {
    color: var(--green-900);
    text-decoration: underline;
}


/* ─────────────────────────────────────
   8. MESSAGES ERREUR / SUCCÈS
   Identiques à l'original (même classes)
───────────────────────────────────── */
.form-message {
    display: none;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: .85rem;
    font-weight: 600;
    margin-bottom: 20px;
    text-align: center;
    animation: authFadeIn .3s ease;
}

.form-message.error {
    display: block;
    background: #fff0f0;
    color: #c0392b;
    border: 1px solid #ffcdd2;
}

.form-message.success {
    display: block;
    background: #f1f8e9;
    color: var(--green-900);
    border: 1px solid #c5e1a5;
}


/* ─────────────────────────────────────
   9. BOUTON RETOUR FLOTTANT
───────────────────────────────────── */
.floating-back {
    position: fixed; top: 24px; left: 28px;
    display: inline-flex; align-items: center; gap: 8px;
    padding: 9px 18px;
    background: #fff;
    color: var(--brown-500);
    font-family: var(--font-heading);
    font-size: .8rem;
    font-weight: 700;
    border-radius: 50px;
    box-shadow: 0 4px 14px rgba(22,53,40,.08);
    border: 1px solid rgba(197,160,89,.18);
    text-decoration: none;
    transition: var(--transition-fast);
    z-index: 200;
}

.floating-back:hover {
    color: var(--green-950);
    transform: translateX(-4px);
    border-color: rgba(197,160,89,.4);
}

.floating-back .material-icons-round { font-size: 1.1rem; }


/* ─────────────────────────────────────
   10. MODAL MOT DE PASSE OUBLIÉ
   Identique à l'original (logique JS inchangée)
───────────────────────────────────── */
.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(22,53,40,.42);
    backdrop-filter: blur(5px);
    display: flex; align-items: center; justify-content: center;
    z-index: 1000;
    opacity: 0; visibility: hidden;
    transition: all .3s ease;
    padding: 20px;
}

.modal-overlay.active { opacity: 1; visibility: visible; }

.modal-card {
    background: #fff;
    padding: 40px 36px;
    border-radius: var(--radius-md);
    width: 100%; max-width: 400px;
    position: relative;
    transform: translateY(20px);
    transition: transform .3s ease;
    box-shadow: 0 24px 60px rgba(0,0,0,.15);
    text-align: center;
}

.modal-overlay.active .modal-card { transform: translateY(0); }

.modal-icon {
    width: 60px; height: 60px;
    border-radius: 50%;
    background: rgba(22,53,40,.07);
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 18px;
}

.modal-icon .material-icons-round {
    font-size: 1.6rem;
    color: var(--green-900);
}

.modal-card h3 {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--green-950);
    margin-bottom: 10px;
}

.modal-card p {
    font-family: var(--font-body);
    font-size: .88rem;
    color: var(--brown-500);
    margin-bottom: 24px;
    line-height: 1.6;
}

.modal-card .input-group { text-align: left; }

.close-modal {
    position: absolute; top: 14px; right: 14px;
    background: var(--beige-100); border: none; border-radius: 50%;
    width: 34px; height: 34px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; color: var(--brown-500);
    transition: var(--transition-fast);
}

.close-modal:hover { background: var(--gold-500); color: #fff; }
.close-modal .material-icons-round { font-size: 1rem; }


/* ─────────────────────────────────────
   11. RESPONSIVE
───────────────────────────────────── */
@media (max-width: 860px) {
    /* Passe en 1 colonne : panneau déco masqué */
    .auth-wrapper { grid-template-columns: 1fr; }
    .auth-deco { display: none; }
    .auth-panel {
        padding: 48px 28px;
        min-height: 100vh;
        justify-content: center;
    }
    /* Afficher logo mobile */
    .auth-logo-mobile { display: block; }
    /* Retour : icône seule */
    .floating-back { padding: 9px 12px; top: 16px; left: 16px; }
    .back-text { display: none; }
}

@media (max-width: 480px) {
    .auth-panel { padding: 36px 20px; }

    .auth-form-header h2 { font-size: 1.2rem; }
    .toggle-btn { font-size: .78rem; padding: 10px 8px; }

    .btn-auth-submit { padding: 13px; font-size: .85rem; }

    .modal-card { padding: 28px 20px; }
}

.auth-separator {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0;
    color: #aaa;
    font-family: var(--font-body);
    font-size: .82rem;
}

.auth-separator::before,
.auth-separator::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(22,53,40,.1);
}

.btn-google {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 12px;
    font-family: var(--font-heading);
    font-size: .88rem;
    font-weight: 600;
    color: var(--brown-900);
    background: #fff;
    border: 1.5px solid rgba(22,53,40,.15);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: var(--transition-fast);
}

.btn-google:hover {
    border-color: var(--green-900);
    box-shadow: 0 4px 12px rgba(22,53,40,.1);
    transform: translateY(-1px);
}