/* ================================================================
   MYCICERON - Authentication Styles
   Design luxe avec glassmorphism et tons bleu marine/or
   ================================================================ */

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* ================================================================
   Auth Page Layout
   ================================================================ */

@keyframes authFadeUp {
    from { opacity: 0; transform: translateY(24px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes authPulse {
    0%, 100% { opacity: 0.45; }
    50% { opacity: 0.9; }
}

@keyframes authFloat {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(4deg); }
}

.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(160deg, #1a2a3a 0%, #0f1a24 100%);
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    padding: 2.5rem 2rem;
    position: relative;
    overflow-x: hidden;
}

/* Background decorative elements */
.bg-orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(80px);
    pointer-events: none;
    z-index: 0;
    animation: authPulse 9s ease-in-out infinite;
}

.bg-orb--1 {
    width: 620px;
    height: 620px;
    background: radial-gradient(circle, rgba(196, 160, 82, 0.13) 0%, transparent 70%);
    top: -220px;
    right: -120px;
}

.bg-orb--2 {
    width: 520px;
    height: 520px;
    background: radial-gradient(circle, rgba(196, 160, 82, 0.09) 0%, transparent 70%);
    bottom: -180px;
    left: -120px;
    animation-delay: 4.5s;
}

.bg-scales {
    position: fixed;
    font-size: 9rem;
    line-height: 1;
    color: rgba(196, 160, 82, 0.05);
    filter: blur(2px);
    pointer-events: none;
    z-index: 0;
    animation: authFloat 22s ease-in-out infinite;
}

.bg-scales--1 { top: 12%; left: 8%; }
.bg-scales--2 { bottom: 12%; right: 8%; animation-delay: 11s; }

@media (max-width: 1200px) {
    .bg-scales { display: none; }
}

.auth-container {
    width: 100%;
    max-width: 460px;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 1;
    animation: authFadeUp 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* ================================================================
   Logo
   ================================================================ */

.auth-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    margin-bottom: 2rem;
    transition: transform 0.3s ease;
}

.auth-logo:hover {
    transform: scale(1.02);
}

.auth-logo .logo-icon {
    font-size: 2.5rem;
    color: #c4a052;
    text-shadow: 0 0 40px rgba(196, 160, 82, 0.45);
}

.auth-logo .logo-text {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 2rem;
    font-weight: 700;
    color: #c4a052;
    letter-spacing: 0.08em;
    text-shadow: 0 2px 20px rgba(196, 160, 82, 0.25);
}

/* ================================================================
   Auth Card (Glassmorphism)
   ================================================================ */

.auth-card {
    width: 100%;
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.055) 0%, rgba(255, 255, 255, 0.02) 100%);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border: 1px solid rgba(196, 160, 82, 0.2);
    border-radius: 22px;
    padding: 2.5rem;
    box-shadow: 0 40px 80px -20px rgba(0, 0, 0, 0.55),
                0 0 0 1px rgba(196, 160, 82, 0.08) inset;
}

/* Filet doré en haut de la carte */
.auth-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, #c4a052 50%, transparent 100%);
    opacity: 0.6;
}

/* ================================================================
   Parcours unifie : une seule carte, trois etapes
   L'etape courante est portee par [data-step] sur .auth-flow, ce qui garde
   le parcours fonctionnel sans JavaScript (le serveur rend la bonne etape).
   ================================================================ */

.auth-flow {
    display: flex;
    flex-direction: column;
}

/* A l'etape 1, Google est l'alternative proposee d'emblee ; aux etapes suivantes
   il passe sous le formulaire, l'action principale etant le mot de passe. */
.auth-flow[data-step="password"] .auth-form,
.auth-flow[data-step="signup"] .auth-form { order: 2; }
.auth-flow[data-step="password"] .auth-divider,
.auth-flow[data-step="signup"] .auth-divider { order: 3; margin: 1.75rem 0 1.5rem; }
.auth-flow[data-step="password"] .social-auth,
.auth-flow[data-step="signup"] .social-auth { order: 4; margin-bottom: 0; }

/* .auth-flow prefixe la regle pour passer devant `.auth-form { display: flex }` */
.auth-flow .auth-step {
    display: none;
}

.auth-flow[data-step="email"] .auth-step[data-panel~="email"],
.auth-flow[data-step="password"] .auth-step[data-panel~="password"],
.auth-flow[data-step="signup"] .auth-step[data-panel~="signup"] {
    display: block;
    animation: authFadeUp 0.35s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* Les formulaires, eux, restent en colonne */
.auth-flow[data-step="email"] form.auth-step[data-panel~="email"],
.auth-flow[data-step="password"] form.auth-step[data-panel~="password"],
.auth-flow[data-step="signup"] form.auth-step[data-panel~="signup"] {
    display: flex;
}

/* Rappel de l'adresse saisie (etapes 2 et 3) */
.auth-identity {
    display: none;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    padding: 0.7rem 0.9rem;
    background: rgba(196, 160, 82, 0.07);
    border: 1px solid rgba(196, 160, 82, 0.22);
    border-radius: 10px;
}

/* .auth-step est repete pour passer devant la regle d'affichage des etapes */
.auth-flow[data-step="password"] .auth-step.auth-identity,
.auth-flow[data-step="signup"] .auth-step.auth-identity {
    display: flex;
}

.auth-identity__info {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    min-width: 0;
    color: #c4a052;
}

.auth-identity__info svg {
    flex-shrink: 0;
}

.auth-identity__email {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.9rem;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.auth-identity__change {
    flex-shrink: 0;
    padding: 0.3rem 0.6rem;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 7px;
    color: rgba(255, 255, 255, 0.7);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.auth-identity__change:hover {
    color: #0f1a24;
    background: #c4a052;
    border-color: #c4a052;
}

.auth-error[hidden] {
    display: none;
}

/* ================================================================
   Benefices (etape inscription)
   ================================================================ */

.auth-benefits {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    padding: 1rem 1.1rem;
    background: rgba(196, 160, 82, 0.06);
    border: 1px solid rgba(196, 160, 82, 0.18);
    border-radius: 12px;
}

.auth-benefits li {
    position: relative;
    padding-left: 1.6rem;
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.875rem;
    line-height: 1.4;
}

.auth-benefits li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.15rem;
    width: 14px;
    height: 8px;
    border-left: 2px solid #c4a052;
    border-bottom: 2px solid #c4a052;
    transform: rotate(-45deg);
}

/* ================================================================
   Bouton secondaire contour dore
   ================================================================ */

.btn-auth-outline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.8rem 1.25rem;
    background: transparent;
    border: 1.5px solid #c4a052;
    border-radius: 10px;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    color: #d4b572;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-auth-outline:hover {
    background: linear-gradient(135deg, #d4b572 0%, #c4a052 100%);
    color: #0f1a24;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(196, 160, 82, 0.35);
}

.btn-auth-outline svg {
    transition: transform 0.2s ease;
}

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

/* ================================================================
   Auth Header
   ================================================================ */

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-header h1 {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.75rem;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 0.5rem;
    letter-spacing: 0.02em;
}

.auth-header p {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.95rem;
}

.auth-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    background: rgba(196, 160, 82, 0.1);
    border: 1px solid rgba(196, 160, 82, 0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #c4a052;
}

.auth-icon.warning {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
    color: #ef4444;
}

/* ================================================================
   Social Auth Buttons
   ================================================================ */

.social-auth {
    margin-bottom: 1.5rem;
}

.btn-google {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.875rem 1.5rem;
    background: #ffffff;
    border: none;
    border-radius: 10px;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.95rem;
    font-weight: 500;
    color: #374151;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.btn-google:hover {
    background: #f9fafb;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(-1px);
}

.btn-google .google-icon {
    flex-shrink: 0;
}

/* ================================================================
   Divider
   ================================================================ */

.auth-divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
}

.auth-divider span {
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* ================================================================
   Form Styles
   ================================================================ */

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.875rem;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 0.875rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: #ffffff;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.form-group input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.form-group input:focus {
    outline: none;
    border-color: #c4a052;
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 3px rgba(196, 160, 82, 0.1);
}

.form-group input.error {
    border-color: #ef4444;
}

.field-error {
    color: #ef4444;
    font-size: 0.8rem;
}

/* ================================================================
   Error Messages
   ================================================================ */

.auth-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 0.5rem;
}

.auth-error p {
    color: #fca5a5;
    font-size: 0.875rem;
    margin: 0;
}

/* ================================================================
   Form Options (Remember Me & Forgot Password)
   ================================================================ */

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.remember-me input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #c4a052;
    cursor: pointer;
}

.remember-me span {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.875rem;
}

.forgot-password {
    color: #c4a052;
    font-size: 0.875rem;
    text-decoration: none;
    transition: color 0.2s ease;
}

.forgot-password:hover {
    color: #d4b572;
    text-decoration: underline;
}

/* ================================================================
   Buttons
   ================================================================ */

.btn-auth-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.875rem 1.5rem;
    background: linear-gradient(135deg, #d4b572 0%, #c4a052 100%);
    border: none;
    border-radius: 10px;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    color: #0f1a24;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 15px rgba(196, 160, 82, 0.3);
}

.btn-auth-primary:hover {
    background: linear-gradient(135deg, #e0c382 0%, #d4b572 100%);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(196, 160, 82, 0.4);
}

.btn-auth-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.95rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-auth-secondary:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.3);
}

/* ================================================================
   Logout & Cancelled Actions
   ================================================================ */

.logout-actions,
.cancelled-actions {
    display: flex;
    gap: 1rem;
    margin-top: 0.5rem;
}

.logout-actions .btn-auth-secondary,
.cancelled-actions .btn-auth-secondary {
    flex: 1;
}

.logout-actions .btn-auth-primary,
.cancelled-actions .btn-auth-primary {
    flex: 1;
}

/* ================================================================
   Auth Links
   ================================================================ */

.auth-links {
    text-align: center;
    margin-top: 1.75rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.auth-links p {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
}

.auth-links a {
    color: #c4a052;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.auth-links a:hover {
    color: #d4b572;
    text-decoration: underline;
}

/* ================================================================
   Auth Footer
   ================================================================ */

.auth-footer {
    margin-top: 2rem;
    text-align: center;
}

.auth-footer p {
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.8rem;
}

/* ================================================================
   Responsive
   ================================================================ */

@media (max-width: 480px) {
    .auth-page {
        padding: 1rem;
    }

    .auth-card {
        padding: 1.5rem;
        border-radius: 16px;
    }

    .auth-logo .logo-text {
        font-size: 1.5rem;
    }

    .auth-header h1 {
        font-size: 1.5rem;
    }

    .form-options {
        flex-direction: column;
        align-items: flex-start;
    }

    .auth-identity {
        padding: 0.6rem 0.7rem;
    }

    .logout-actions,
    .cancelled-actions {
        flex-direction: column;
    }
}
