/* ========================================
   YEEN Auth Pages Styles (Dark Theme)
   ======================================== */

/* Base Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    height: 100%;
}

body.auth-body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-body, #0d0d1a);
    color: var(--text-primary, #ffffff);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow-x: hidden;
}

/* ========================================
   Background Effects
   ======================================== */
.bg-grid {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        linear-gradient(rgba(248, 132, 20, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(248, 132, 20, 0.03) 1px, transparent 1px);
    background-size: 60px 60px;
    pointer-events: none;
    z-index: 0;
}

.bg-glow {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(248, 132, 20, 0.1) 0%, transparent 60%);
    pointer-events: none;
    z-index: 0;
}

/* ========================================
   Back Link
   ======================================== */
.back-link {
    position: fixed;
    top: 24px;
    left: 24px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary, #94a3b8);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    padding: 10px 16px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.2s ease;
    z-index: 100;
}

.back-link:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary, #ffffff);
    transform: translateX(-2px);
}

/* ========================================
   Auth Container
   ======================================== */
.auth-container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 440px;
    padding: 24px;
}

.auth-card {
    background: rgba(30, 30, 47, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 24px;
    padding: 32px;
    /* Reduced from 40px */
    box-shadow:
        0 25px 80px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.03) inset;
    animation: fadeInUp 0.5s ease-out;
}

/* ========================================
   Logo
   ======================================== */
.auth-logo {
    text-align: center;
    margin-bottom: 32px;
}

.auth-logo img {
    height: 48px;
    width: auto;
    filter: drop-shadow(0 4px 12px rgba(248, 132, 20, 0.3));
}

/* ========================================
   Header
   ======================================== */
.auth-header {
    text-align: center;
    margin-bottom: 32px;
}

.auth-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: -0.02em;
}

.auth-header p {
    color: var(--text-secondary, #94a3b8);
    font-size: 0.9375rem;
}

/* ========================================
   Form Styles
   ======================================== */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-secondary, #94a3b8);
}

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

.input-icon {
    position: absolute;
    left: 14px;
    color: var(--text-muted, #5a5a7a);
    pointer-events: none;
    transition: color 0.2s ease;
}

.input-wrapper input {
    width: 100%;
    padding: 12px 14px 12px 46px;
    /* Slightly reduced padding */
    font-family: inherit;
    font-size: 1rem;
    /* Forced to 16px (1rem) to prevent auto-zoom on iOS */
    color: var(--text-primary, #ffffff);
    background: rgba(255, 255, 255, 0.04);
    border: 2px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    outline: none;
    transition: all 0.2s ease;
}

.input-wrapper input::placeholder {
    color: var(--text-muted, #5a5a7a);
}

.input-wrapper input:hover {
    border-color: rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.06);
}

.input-wrapper input:focus {
    border-color: var(--primary, #F88414);
    background: rgba(255, 255, 255, 0.06);
    box-shadow: 0 0 0 3px rgba(248, 132, 20, 0.15);
}

.input-wrapper input:focus+.input-icon,
.input-wrapper:focus-within .input-icon {
    color: var(--primary, #F88414);
}

/* Toggle Password Button */
.toggle-password {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    padding: 6px;
    color: var(--text-muted, #5a5a7a);
    cursor: pointer;
    transition: color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toggle-password:hover {
    color: var(--primary, #F88414);
}

/* Password input needs extra padding for toggle */
.form-group:has(.toggle-password) .input-wrapper input {
    padding-right: 46px;
}

/* ========================================
   Form Options
   ======================================== */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: -8px;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.8125rem;
    color: var(--text-secondary, #94a3b8);
    cursor: pointer;
    position: relative;
    padding-left: 28px;
}

.remember-me input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.checkmark {
    position: absolute;
    left: 0;
    width: 18px;
    height: 18px;
    background: rgba(255, 255, 255, 0.04);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    transition: all 0.2s ease;
}

.remember-me input:checked~.checkmark {
    background: var(--primary, #F88414);
    border-color: var(--primary, #F88414);
}

.checkmark::after {
    content: '';
    position: absolute;
    display: none;
    left: 5px;
    top: 2px;
    width: 4px;
    height: 8px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.remember-me input:checked~.checkmark::after {
    display: block;
}

.forgot-link {
    font-size: 0.8125rem;
    color: var(--primary, #F88414);
    text-decoration: none;
    font-weight: 500;
    transition: opacity 0.2s ease;
}

.forgot-link:hover {
    opacity: 0.8;
}

/* ========================================
   Submit Button
   ======================================== */
.btn-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 16px;
    margin-top: 8px;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    color: white;
    background: linear-gradient(135deg, var(--primary, #F88414) 0%, var(--primary-dark, #E07010) 100%);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 25px rgba(248, 132, 20, 0.3);
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 35px rgba(248, 132, 20, 0.4);
}

.btn-submit:active {
    transform: translateY(-1px);
}

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

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

/* ========================================
   Divider
   ======================================== */
.auth-divider {
    display: flex;
    align-items: center;
    margin: 24px 0;
}

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

.auth-divider span {
    padding: 0 16px;
    font-size: 0.8125rem;
    color: var(--text-muted, #5a5a7a);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ========================================
   Social Login
   ======================================== */
.social-login {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.btn-social {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px;
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary, #ffffff);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-social:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.12);
}

/* ========================================
   Footer Link
   ======================================== */
.auth-footer {
    text-align: center;
    margin-top: 24px;
    font-size: 0.875rem;
    color: var(--text-secondary, #94a3b8);
}

.auth-footer a {
    color: var(--primary, #F88414);
    text-decoration: none;
    font-weight: 600;
    transition: opacity 0.2s ease;
}

.auth-footer a:hover {
    opacity: 0.8;
}

/* ========================================
   Animations
   ======================================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   Responsive - Tablet
   ======================================== */
@media (max-width: 768px) {
    .auth-container {
        padding: 20px;
    }

    .auth-card {
        padding: 36px 28px;
    }

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

    .form-row {
        flex-direction: column;
    }

    .social-login {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   Responsive - Mobile
   ======================================== */
@media (max-width: 480px) {
    body.auth-body {
        align-items: flex-start;
        /* Pousse vers le haut pour laisser de la place au clavier mobile */
        padding: 80px 12px 24px 12px;
        min-height: 100%;
        overflow-y: auto;
    }

    .back-link {
        top: 16px;
        left: 16px;
        padding: 8px 12px;
        font-size: 0.8125rem;
        background: rgba(13, 13, 26, 0.8);
        backdrop-filter: blur(10px);
    }

    .auth-container {
        padding: 0;
        margin: 0 auto;
    }

    .auth-card {
        padding: 28px 20px;
        border-radius: 20px;
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    }

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

    .social-login {
        grid-template-columns: 1fr;
    }

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

    .form-row {
        flex-direction: column;
        gap: 20px;
    }

    .password-rules {
        padding: 12px;
        gap: 6px 12px;
    }
}

/* ========================================
   Wide Container (Register)
   ======================================== */
.auth-container-wide {
    max-width: 520px;
}

/* ========================================
   Auth Icon
   ======================================== */
.auth-icon {
    text-align: center;
    margin-bottom: 24px;
}

.auth-icon svg {
    color: var(--primary, #F88414);
    opacity: 0.9;
}

/* ========================================
   Form Row (2 columns)
   ======================================== */
.form-row {
    display: flex;
    gap: 16px;
}

.form-row .form-group {
    flex: 1;
}

/* ========================================
   Password Rules
   ======================================== */
.password-rules {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    margin-top: -8px;
}

.password-rules .rule {
    font-size: 0.75rem;
    font-weight: 500;
    color: #ef4444;
    white-space: nowrap;
    transition: color 0.2s ease;
}

.password-rules .rule.valid {
    color: #22c55e;
}

/* ========================================
   Code Input
   ======================================== */
.code-input {
    text-align: center;
    font-size: 1.75rem !important;
    font-weight: 600 !important;
    letter-spacing: 12px;
    padding-left: 24px !important;
    padding-right: 14px !important;
}

.input-wrapper-center {
    justify-content: center;
}

.input-wrapper-center input {
    padding-left: 14px;
}

/* ========================================
   Loading Overlay
   ======================================== */
.loading-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(13, 13, 26, 0.95);
    backdrop-filter: blur(10px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 16px;
}

.loading-overlay.active {
    display: flex;
}

.loading-overlay p {
    color: var(--text-secondary, #94a3b8);
    font-size: 0.9375rem;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top: 4px solid var(--primary, #F88414);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* ========================================
   Date Input Fix
   ======================================== */
input[type="date"] {
    color-scheme: dark;
}

input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(0.7);
    cursor: pointer;
}

/* ========================================
   Input Hint
   ======================================== */
.input-hint {
    display: block;
    margin-top: 6px;
    font-size: 0.75rem;
    color: var(--text-muted, #64748b);
    line-height: 1.4;
}

/* ========================================
   Checkbox Group (CGU/CGV)
   ======================================== */
.checkbox-group {
    margin-top: 12px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--text-secondary, #94a3b8);
    line-height: 1.6;
}

.checkbox-label input[type="checkbox"] {
    display: none;
}

.checkbox-custom {
    width: 22px;
    height: 22px;
    min-width: 22px;
    border: 2px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    margin-top: 1px;
}

.checkbox-label:hover .checkbox-custom {
    border-color: var(--primary, #F88414);
    background: rgba(248, 132, 20, 0.1);
}

.checkbox-custom::after {
    content: '';
    width: 10px;
    height: 6px;
    border: 2px solid white;
    border-top: none;
    border-right: none;
    transform: rotate(-45deg) scale(0);
    transition: transform 0.2s ease;
}

.checkbox-label input[type="checkbox"]:checked+.checkbox-custom {
    background: var(--primary, #F88414);
    border-color: var(--primary, #F88414);
}

.checkbox-label input[type="checkbox"]:checked+.checkbox-custom::after {
    transform: rotate(-45deg) scale(1);
}

.checkbox-text {
    flex: 1;
}

.checkbox-text a {
    color: var(--primary, #F88414);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s;
}

.checkbox-text a:hover {
    text-decoration: underline;
}