/* ========================================
   AUTHENTICATION PAGES - MODERN DESIGN
   Palette harmonisée avec le loader YUGO
   ======================================== */

/* Google Fonts - Inter for consistency with main app */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ========================================
   CSS VARIABLES - YUGO BLUE PALETTE
   ======================================== */
:root {
    /* Primary palette - YUGO Blue (harmonisé avec loader) */
    --auth-primary: #0F62FE;
    --auth-primary-hover: #0353E9;
    --auth-primary-light: #D0E2FF;
    --auth-primary-lighter: #E0E7FF;
    --auth-primary-gradient: linear-gradient(135deg, #0F62FE 0%, #3B82F6 100%);
    --auth-primary-soft: rgba(15, 98, 254, 0.08);

    /* Secondary colors */
    --auth-secondary: #1E293B;
    --auth-accent: #3B82F6;
    --auth-accent-light: #DBEAFE;

    /* Surface colors - Light & airy */
    --auth-surface: #FFFFFF;
    --auth-surface-secondary: #F8FAFC;
    --auth-surface-tertiary: #F1F5F9;
    --auth-surface-brand: linear-gradient(135deg, #F8FAFC 0%, #E0E7FF 50%, #DBEAFE 100%);

    /* Text colors */
    --auth-text-primary: #1F2937;
    --auth-text-secondary: #475569;
    --auth-text-muted: #94A3B8;
    --auth-text-inverse: #FFFFFF;

    /* Border colors */
    --auth-border: #E2E8F0;
    --auth-border-focus: #0F62FE;

    /* Status colors */
    --auth-success: #10B981;
    --auth-success-light: #D1FAE5;
    --auth-error: #EF4444;
    --auth-error-light: #FEE2E2;
    --auth-warning: #F59E0B;
    --auth-warning-light: #FEF3C7;
    --auth-info: #3B82F6;
    --auth-info-light: #DBEAFE;

    /* Shadows - Soft blue tint */
    --auth-shadow-sm: 0 1px 2px 0 rgba(15, 98, 254, 0.04);
    --auth-shadow-md: 0 4px 6px -1px rgba(15, 98, 254, 0.08), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
    --auth-shadow-lg: 0 10px 15px -3px rgba(15, 98, 254, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
    --auth-shadow-xl: 0 20px 25px -5px rgba(15, 98, 254, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.03);
    --auth-shadow-2xl: 0 25px 50px -12px rgba(15, 98, 254, 0.15);
    --auth-shadow-glow: 0 0 40px rgba(15, 98, 254, 0.12);
    --auth-shadow-button: 0 4px 14px rgba(15, 98, 254, 0.35);

    /* Border radius */
    --auth-radius-sm: 8px;
    --auth-radius-md: 12px;
    --auth-radius-lg: 16px;
    --auth-radius-xl: 24px;
    --auth-radius-2xl: 32px;
    --auth-radius-full: 9999px;

    /* Typography - Inter for consistency */
    --auth-font-display: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --auth-font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

    /* Transitions */
    --auth-transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --auth-transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --auth-transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);
    --auth-transition-bounce: 500ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Dark mode variables */
[data-bs-theme="dark"] {
    --auth-surface: #1E293B;
    --auth-surface-secondary: #0F172A;
    --auth-surface-tertiary: #334155;
    --auth-surface-brand: linear-gradient(135deg, #0F172A 0%, #1E3A5F 50%, #1E293B 100%);
    --auth-text-primary: #F1F5F9;
    --auth-text-secondary: #CBD5E1;
    --auth-text-muted: #64748B;
    --auth-border: #334155;
    --auth-primary-light: rgba(15, 98, 254, 0.2);
    --auth-primary-soft: rgba(15, 98, 254, 0.15);
    --auth-shadow-glow: 0 0 60px rgba(15, 98, 254, 0.15);
}

/* ========================================
   BASE LAYOUT
   ======================================== */
.auth-page {
    min-height: 100vh;
    display: flex;
    font-family: var(--auth-font-body);
    background: var(--auth-surface-secondary);
    overflow: hidden;
}

/* ========================================
   LEFT PANEL - BRANDING & ILLUSTRATION
   Design light harmonisé avec le loader YUGO
   ======================================== */
.auth-brand-panel {
    flex: 1;
    display: none;
    position: relative;
    background: linear-gradient(135deg, #F8FAFC 0%, #E0E7FF 50%, #DBEAFE 100%);
    overflow: hidden;
}

@media (min-width: 992px) {
    .auth-brand-panel {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        padding: 3rem;
    }
}

/* Animated background pattern - subtle blue accents */
.auth-brand-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(circle at 20% 80%, rgba(15, 98, 254, 0.06) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(59, 130, 246, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(208, 226, 255, 0.5) 0%, transparent 60%);
    animation: gradientShift 15s ease infinite;
}

@keyframes gradientShift {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.85; transform: scale(1.05); }
}

/* Floating shapes animation - soft blue orbs */
.auth-brand-panel::after {
    content: '';
    position: absolute;
    width: 500px;
    height: 500px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(15, 98, 254, 0.08) 0%, transparent 70%);
    top: -150px;
    right: -150px;
    animation: float 20s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    25% { transform: translate(-20px, 20px) rotate(5deg); }
    50% { transform: translate(0, 40px) rotate(0deg); }
    75% { transform: translate(20px, 20px) rotate(-5deg); }
}

/* Additional floating element */
.auth-brand-panel .auth-brand-content::before {
    content: '';
    position: absolute;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.1) 0%, transparent 70%);
    bottom: -100px;
    left: -100px;
    animation: floatReverse 18s ease-in-out infinite;
    z-index: -1;
}

@keyframes floatReverse {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(30px, -20px); }
}

.auth-brand-content {
    position: relative;
    z-index: 1;
    text-align: center;
    max-width: 480px;
    padding: 2rem;
}

.auth-brand-logo {
    width: 180px;
    height: 180px;
    margin-bottom: 2rem;
    filter: drop-shadow(0 4px 12px rgba(15, 98, 254, 0.15));
    animation: logoFloat 2.5s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes logoFloat {
    0%, 100% {
        transform: translateY(0) scale(1);
        opacity: 0.95;
    }
    50% {
        transform: translateY(-8px) scale(1.05);
        opacity: 1;
    }
}

.auth-brand-title {
    font-family: var(--auth-font-display);
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--auth-text-primary);
    margin-bottom: 1.5rem;
    line-height: 1.3;
    letter-spacing: -0.02em;
}

.auth-brand-description {
    font-size: 1.0625rem;
    color: var(--auth-text-secondary);
    line-height: 1.7;
    margin-bottom: 2.5rem;
}

/* Feature list */
.auth-features {
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
    text-align: left;
}

.auth-feature-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(15, 98, 254, 0.08);
    border-radius: var(--auth-radius-md);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 8px rgba(15, 98, 254, 0.06);
    transition: var(--auth-transition-base);
    animation: slideInLeft 0.6s ease-out backwards;
}

.auth-feature-item:nth-child(1) { animation-delay: 0.1s; }
.auth-feature-item:nth-child(2) { animation-delay: 0.2s; }
.auth-feature-item:nth-child(3) { animation-delay: 0.3s; }

.auth-feature-item:hover {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(15, 98, 254, 0.15);
    transform: translateX(8px);
    box-shadow: 0 4px 12px rgba(15, 98, 254, 0.1);
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.auth-feature-icon {
    width: 42px;
    height: 42px;
    border-radius: var(--auth-radius-sm);
    background: linear-gradient(135deg, var(--auth-primary) 0%, var(--auth-accent) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(15, 98, 254, 0.25);
}

.auth-feature-icon svg {
    width: 20px;
    height: 20px;
    color: var(--auth-text-inverse);
}

.auth-feature-text {
    color: var(--auth-text-primary);
    font-weight: 500;
    font-size: 0.9rem;
}

/* Illustration */
.auth-illustration {
    max-width: 100%;
    height: auto;
    margin-top: 3rem;
    filter: drop-shadow(0 20px 40px rgba(15, 98, 254, 0.15));
    animation: illustrationFloat 8s ease-in-out infinite;
}

@keyframes illustrationFloat {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-10px) scale(1.01); }
}

/* ========================================
   RIGHT PANEL - FORM AREA
   ======================================== */
.auth-form-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2rem 1.5rem;
    background: var(--auth-surface);
    overflow-y: auto;
}

@media (min-width: 992px) {
    .auth-form-panel {
        max-width: 600px;
        padding: 3rem;
    }
}

.auth-form-container {
    width: 100%;
    max-width: 440px;
    animation: fadeInUp 0.6s ease-out;
}

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

/* Mobile logo */
.auth-mobile-logo {
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
}

@media (min-width: 992px) {
    .auth-mobile-logo {
        display: none;
    }
}

.auth-mobile-logo img {
    height: 48px;
    width: auto;
}

/* ========================================
   FORM HEADER
   ======================================== */
.auth-form-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-form-title {
    font-family: var(--auth-font-display);
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--auth-text-primary);
    margin-bottom: 0.75rem;
    letter-spacing: -0.02em;
}

.auth-form-subtitle {
    font-size: 1rem;
    color: var(--auth-text-secondary);
    line-height: 1.6;
}

.auth-form-subtitle a {
    color: var(--auth-primary);
    font-weight: 600;
    text-decoration: none;
    transition: var(--auth-transition-fast);
}

.auth-form-subtitle a:hover {
    color: var(--auth-primary-hover);
    text-decoration: underline;
}

/* ========================================
   SOCIAL LOGIN BUTTONS
   ======================================== */
.auth-social-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.auth-social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.875rem 1.5rem;
    border-radius: var(--auth-radius-md);
    font-size: 0.95rem;
    font-weight: 600;
    font-family: var(--auth-font-body);
    text-decoration: none;
    transition: var(--auth-transition-base);
    cursor: pointer;
    border: 2px solid var(--auth-border);
    background: var(--auth-surface);
    color: var(--auth-text-primary);
}

.auth-social-btn:hover {
    border-color: var(--auth-text-muted);
    background: var(--auth-surface-secondary);
    transform: translateY(-2px);
    box-shadow: var(--auth-shadow-md);
}

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

.auth-social-btn img,
.auth-social-btn svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* Google button specific */
.auth-social-btn--google:hover {
    border-color: #4285F4;
    background: rgba(66, 133, 244, 0.05);
}

/* ========================================
   DIVIDER
   ======================================== */
.auth-divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1.5rem 0;
}

.auth-divider-line {
    flex: 1;
    height: 1px;
    background: var(--auth-border);
}

.auth-divider-text {
    font-size: 0.85rem;
    color: var(--auth-text-muted);
    font-weight: 500;
    white-space: nowrap;
}

/* ========================================
   FORM STYLES
   ======================================== */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

/* Form group */
.auth-form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.auth-form-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

@media (min-width: 480px) {
    .auth-form-row {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Labels */
.auth-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--auth-text-primary);
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.auth-label-required {
    color: var(--auth-error);
}

/* Input wrapper */
.auth-input-wrapper {
    position: relative;
}

/* Inputs */
.auth-input {
    width: 100%;
    padding: 0.875rem 1rem;
    font-size: 0.95rem;
    font-family: var(--auth-font-body);
    color: var(--auth-text-primary);
    background: var(--auth-surface);
    border: 2px solid var(--auth-border);
    border-radius: var(--auth-radius-md);
    outline: none;
    transition: var(--auth-transition-base);
}

.auth-input::placeholder {
    color: var(--auth-text-muted);
}

.auth-input:hover {
    border-color: var(--auth-text-muted);
}

.auth-input:focus {
    border-color: var(--auth-primary);
    box-shadow: 0 0 0 4px var(--auth-primary-light);
}

/* Input with icon */
.auth-input--with-icon {
    padding-left: 2.75rem;
}

.auth-input-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    color: var(--auth-text-muted);
    pointer-events: none;
    transition: var(--auth-transition-base);
}

.auth-input:focus ~ .auth-input-icon,
.auth-input:not(:placeholder-shown) ~ .auth-input-icon {
    color: var(--auth-primary);
}

/* Password toggle */
.auth-password-toggle {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 0.25rem;
    cursor: pointer;
    color: var(--auth-text-muted);
    transition: var(--auth-transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-password-toggle:hover {
    color: var(--auth-text-primary);
}

.auth-password-toggle svg {
    width: 20px;
    height: 20px;
}

/* Password strength meter */
.auth-password-strength {
    display: flex;
    gap: 0.375rem;
    margin-top: 0.5rem;
}

.auth-password-strength-bar {
    flex: 1;
    height: 4px;
    border-radius: var(--auth-radius-full);
    background: var(--auth-border);
    transition: var(--auth-transition-base);
}

.auth-password-strength-bar.active {
    background: var(--auth-text-muted);
}

.auth-password-strength-bar.weak {
    background: var(--auth-error);
}

.auth-password-strength-bar.medium {
    background: var(--auth-warning);
}

.auth-password-strength-bar.strong {
    background: var(--auth-success);
}

.auth-password-hint {
    font-size: 0.8rem;
    color: var(--auth-text-muted);
    margin-top: 0.5rem;
}

/* Select styling */
.auth-select {
    width: 100%;
    padding: 0.875rem 2.5rem 0.875rem 1rem;
    font-size: 0.95rem;
    font-family: var(--auth-font-body);
    color: var(--auth-text-primary);
    background: var(--auth-surface);
    border: 2px solid var(--auth-border);
    border-radius: var(--auth-radius-md);
    outline: none;
    transition: var(--auth-transition-base);
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%2394A3B8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    cursor: pointer;
}

.auth-select:hover {
    border-color: var(--auth-text-muted);
}

.auth-select:focus {
    border-color: var(--auth-primary);
    box-shadow: 0 0 0 4px var(--auth-primary-light);
}

/* Checkbox */
.auth-checkbox-wrapper {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.auth-checkbox {
    width: 20px;
    height: 20px;
    border: 2px solid var(--auth-border);
    border-radius: var(--auth-radius-sm);
    cursor: pointer;
    appearance: none;
    background: var(--auth-surface);
    transition: var(--auth-transition-fast);
    flex-shrink: 0;
    position: relative;
}

.auth-checkbox:checked {
    background: var(--auth-primary);
    border-color: var(--auth-primary);
}

.auth-checkbox:checked::after {
    content: '';
    position: absolute;
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.auth-checkbox:focus {
    box-shadow: 0 0 0 4px var(--auth-primary-light);
}

.auth-checkbox-label {
    font-size: 0.9rem;
    color: var(--auth-text-secondary);
    line-height: 1.5;
}

.auth-checkbox-label a {
    color: var(--auth-primary);
    font-weight: 600;
    text-decoration: none;
}

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

/* Forgot password link */
.auth-forgot-link {
    font-size: 0.9rem;
    color: var(--auth-primary);
    font-weight: 600;
    text-decoration: none;
    transition: var(--auth-transition-fast);
    align-self: flex-end;
}

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

/* ========================================
   VALIDATION STATES
   ======================================== */
.auth-input.is-valid {
    border-color: var(--auth-success);
}

.auth-input.is-valid:focus {
    box-shadow: 0 0 0 4px var(--auth-success-light);
}

.auth-input.is-invalid {
    border-color: var(--auth-error);
}

.auth-input.is-invalid:focus {
    box-shadow: 0 0 0 4px var(--auth-error-light);
}

.auth-feedback {
    font-size: 0.8rem;
    margin-top: 0.375rem;
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.auth-feedback--success {
    color: var(--auth-success);
}

.auth-feedback--error {
    color: var(--auth-error);
}

.auth-feedback svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

/* ========================================
   SUBMIT BUTTON
   ======================================== */
.auth-submit-btn {
    width: 100%;
    padding: 1rem 1.5rem;
    font-size: 1rem;
    font-weight: 700;
    font-family: var(--auth-font-body);
    color: var(--auth-text-inverse);
    background: var(--auth-primary-gradient);
    border: none;
    border-radius: var(--auth-radius-md);
    cursor: pointer;
    transition: var(--auth-transition-base);
    position: relative;
    overflow: hidden;
    margin-top: 0.5rem;
}

.auth-submit-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: var(--auth-transition-slow);
}

.auth-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--auth-shadow-button);
}

.auth-submit-btn:hover::before {
    left: 100%;
}

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

.auth-submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* Loading state */
.auth-submit-btn--loading .auth-submit-text {
    opacity: 0;
}

.auth-submit-btn--loading .auth-submit-spinner {
    display: flex;
}

.auth-submit-spinner {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    gap: 0.375rem;
}

.auth-submit-spinner span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--auth-text-inverse);
    animation: bounce 1.4s infinite ease-in-out both;
}

.auth-submit-spinner span:nth-child(1) { animation-delay: -0.32s; }
.auth-submit-spinner span:nth-child(2) { animation-delay: -0.16s; }

@keyframes bounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

/* ========================================
   FOOTER LINKS
   ======================================== */
.auth-footer-text {
    text-align: center;
    font-size: 0.95rem;
    color: var(--auth-text-secondary);
    margin-top: 1.5rem;
}

.auth-footer-text a {
    color: var(--auth-primary);
    font-weight: 600;
    text-decoration: none;
    transition: var(--auth-transition-fast);
}

.auth-footer-text a:hover {
    color: var(--auth-primary-hover);
    text-decoration: underline;
}

/* ========================================
   BOTTOM FOOTER
   ======================================== */
.auth-bottom-footer {
    margin-top: auto;
    padding-top: 2rem;
    width: 100%;
    max-width: 440px;
}

.auth-bottom-footer-content {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--auth-border);
}

.auth-bottom-link {
    font-size: 0.85rem;
    color: var(--auth-text-muted);
    text-decoration: none;
    transition: var(--auth-transition-fast);
}

.auth-bottom-link:hover {
    color: var(--auth-primary);
}

/* Language selector */
.auth-language-selector {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border: 1px solid var(--auth-border);
    border-radius: var(--auth-radius-sm);
    background: var(--auth-surface);
    cursor: pointer;
    transition: var(--auth-transition-fast);
}

.auth-language-selector:hover {
    border-color: var(--auth-text-muted);
}

.auth-language-selector img {
    width: 20px;
    height: 15px;
    border-radius: 2px;
    object-fit: cover;
}

.auth-language-selector span {
    font-size: 0.85rem;
    color: var(--auth-text-secondary);
    font-weight: 500;
}

/* ========================================
   ALERTS & MESSAGES
   ======================================== */
.auth-alert {
    padding: 1rem 1.25rem;
    border-radius: var(--auth-radius-md);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-alert--success {
    background: var(--auth-success-light);
    border: 1px solid var(--auth-success);
    color: #065F46;
}

.auth-alert--error {
    background: var(--auth-error-light);
    border: 1px solid var(--auth-error);
    color: #991B1B;
}

.auth-alert--warning {
    background: var(--auth-warning-light);
    border: 1px solid var(--auth-warning);
    color: #92400E;
}

.auth-alert-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    margin-top: 0.125rem;
}

.auth-alert-content {
    flex: 1;
}

.auth-alert-title {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.auth-alert-message {
    font-size: 0.9rem;
    line-height: 1.5;
}

/* ========================================
   LOADING OVERLAY
   ======================================== */
.auth-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: var(--auth-transition-base);
}

.auth-loading-overlay.active {
    opacity: 1;
    visibility: visible;
}

.auth-loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid var(--auth-border);
    border-top-color: var(--auth-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* ========================================
   SIGNUP SPECIFIC - SUBSCRIPTION INFO
   ======================================== */
.auth-subscription-link {
    font-size: 0.85rem;
    color: var(--auth-primary);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    margin-top: 0.5rem;
    transition: var(--auth-transition-fast);
}

.auth-subscription-link:hover {
    color: var(--auth-primary-hover);
    text-decoration: underline;
}

.auth-subscription-link svg {
    width: 16px;
    height: 16px;
}

/* ========================================
   RESPONSIVE ADJUSTMENTS
   ======================================== */
@media (max-width: 480px) {
    .auth-form-panel {
        padding: 1.5rem 1rem;
    }

    .auth-form-title {
        font-size: 1.5rem;
    }

    .auth-input,
    .auth-select {
        padding: 0.75rem 1rem;
        font-size: 16px; /* Prevents zoom on iOS */
    }

    .auth-submit-btn {
        padding: 0.875rem 1.25rem;
    }

    .auth-bottom-footer-content {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }
}

/* Tablet landscape */
@media (min-width: 992px) and (max-width: 1199px) {
    .auth-brand-content {
        padding: 1.5rem;
    }

    .auth-brand-title {
        font-size: 2rem;
    }
}

/* Large screens */
@media (min-width: 1400px) {
    .auth-form-panel {
        max-width: 700px;
    }

    .auth-form-container {
        max-width: 480px;
    }

    .auth-brand-title {
        font-size: 3rem;
    }
}

/* ========================================
   ACCESSIBILITY
   ======================================== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus visible */
.auth-input:focus-visible,
.auth-select:focus-visible,
.auth-checkbox:focus-visible,
.auth-submit-btn:focus-visible,
.auth-social-btn:focus-visible {
    outline: 2px solid var(--auth-primary);
    outline-offset: 2px;
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .auth-input,
    .auth-select {
        border-width: 3px;
    }

    .auth-submit-btn {
        border: 2px solid currentColor;
    }
}

/* ========================================
   PRINT STYLES
   ======================================== */
@media print {
    .auth-brand-panel {
        display: none;
    }

    .auth-form-panel {
        max-width: 100%;
    }
}

/* ========================================
   ADDITIONAL INTEGRATION WITH EXISTING FRAMEWORK
   ======================================== */

/* Override Bootstrap/Metronic form controls in auth pages */
.auth-page .form-control {
    padding: 0.875rem 1rem;
    font-size: 0.95rem;
    border: 2px solid var(--auth-border);
    border-radius: var(--auth-radius-md);
    background: var(--auth-surface);
    transition: var(--auth-transition-base);
}

.auth-page .form-control:focus {
    border-color: var(--auth-primary);
    box-shadow: 0 0 0 4px var(--auth-primary-light);
}

.auth-page .form-select {
    padding: 0.875rem 2.5rem 0.875rem 1rem;
    font-size: 0.95rem;
    border: 2px solid var(--auth-border);
    border-radius: var(--auth-radius-md);
    background-color: var(--auth-surface);
}

.auth-page .form-select:focus {
    border-color: var(--auth-primary);
    box-shadow: 0 0 0 4px var(--auth-primary-light);
}

/* Select2 styling for auth pages */
.auth-page .select2-container--bootstrap-5 .select2-selection {
    padding: 0.875rem 1rem;
    min-height: 52px;
    border: 2px solid var(--auth-border);
    border-radius: var(--auth-radius-md);
    background: var(--auth-surface);
}

.auth-page .select2-container--bootstrap-5 .select2-selection:focus,
.auth-page .select2-container--bootstrap-5.select2-container--focus .select2-selection {
    border-color: var(--auth-primary);
    box-shadow: 0 0 0 4px var(--auth-primary-light);
}

.auth-page .select2-container--bootstrap-5 .select2-selection--single .select2-selection__rendered {
    padding: 0;
    color: var(--auth-text-primary);
}

/* Form validation messages */
.auth-page .fv-plugins-message-container {
    margin-top: 0.375rem;
}

.auth-page .fv-plugins-message-container .fv-help-block {
    font-size: 0.8rem;
    color: var(--auth-error);
}

/* Button primary override */
.auth-page .btn-primary {
    background: var(--auth-primary-gradient);
    border: none;
    font-weight: 700;
    padding: 1rem 1.5rem;
    border-radius: var(--auth-radius-md);
    transition: var(--auth-transition-base);
}

.auth-page .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--auth-shadow-button);
}

/* Link primary override */
.auth-page .link-primary {
    color: var(--auth-primary);
    font-weight: 600;
}

.auth-page .link-primary:hover {
    color: var(--auth-primary-hover);
}

/* Separator styling */
.auth-page .separator-content {
    color: var(--auth-text-muted);
    font-size: 0.85rem;
}

.auth-page .separator-content::before,
.auth-page .separator-content::after {
    border-color: var(--auth-border);
}

/* ========================================
   LANGUAGE SELECTOR - DISTINCT DESIGN
   ======================================== */

.auth-lang-wrapper {
    position: relative;
    z-index: 100;
}

/* Trigger Button */
.auth-lang-trigger {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.625rem 1rem;
    background: transparent;
    border: 2px solid var(--auth-border);
    border-radius: var(--auth-radius-sm);
    cursor: pointer;
    font-family: var(--auth-font-body);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--auth-text-secondary);
    transition: all var(--auth-transition-base);
    min-width: 140px;
}

.auth-lang-trigger:hover {
    border-color: var(--auth-primary);
    color: var(--auth-primary);
    background: var(--auth-primary-light);
}

.auth-lang-trigger.active {
    border-color: var(--auth-primary);
    color: var(--auth-primary);
    background: var(--auth-primary-light);
    box-shadow: 0 0 0 4px var(--auth-primary-soft);
}

.auth-lang-trigger img {
    width: 22px;
    height: 16px;
    border-radius: 3px;
    object-fit: cover;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.auth-lang-trigger span {
    flex: 1;
    text-align: left;
}

.auth-lang-chevron {
    width: 16px;
    height: 16px;
    transition: transform var(--auth-transition-base);
    opacity: 0.6;
}

.auth-lang-trigger.active .auth-lang-chevron {
    transform: rotate(180deg);
    opacity: 1;
}

/* Dropdown Container */
.auth-lang-dropdown {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 0;
    min-width: 220px;
    background: var(--auth-surface);
    border: 1px solid var(--auth-border);
    border-radius: var(--auth-radius-lg);
    box-shadow:
        0 10px 40px rgba(0, 0, 0, 0.12),
        0 0 0 1px rgba(0, 0, 0, 0.04);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px) scale(0.95);
    transition: all var(--auth-transition-base);
    overflow: hidden;
}

.auth-lang-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* Dropdown Header */
.auth-lang-dropdown-header {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.875rem 1rem;
    background: linear-gradient(135deg, var(--auth-surface-secondary) 0%, var(--auth-surface-tertiary) 100%);
    border-bottom: 1px solid var(--auth-border);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--auth-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.auth-lang-dropdown-header svg {
    color: var(--auth-primary);
    opacity: 0.8;
}

/* Language Options */
.auth-lang-options {
    padding: 0.5rem;
}

.auth-lang-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.75rem 1rem;
    background: transparent;
    border: none;
    border-radius: var(--auth-radius-md);
    cursor: pointer;
    font-family: var(--auth-font-body);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--auth-text-primary);
    text-align: left;
    transition: all var(--auth-transition-fast);
    position: relative;
}

.auth-lang-option:hover {
    background: var(--auth-surface-secondary);
}

.auth-lang-option.active {
    background: var(--auth-primary-light);
    color: var(--auth-primary);
}

.auth-lang-option img {
    width: 26px;
    height: 18px;
    border-radius: 4px;
    object-fit: cover;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform var(--auth-transition-fast);
}

.auth-lang-option:hover img {
    transform: scale(1.1);
}

.auth-lang-option-name {
    flex: 1;
}

/* Check Icon */
.auth-lang-check {
    width: 18px;
    height: 18px;
    color: var(--auth-primary);
    opacity: 0;
    transform: scale(0.5);
    transition: all var(--auth-transition-fast);
}

.auth-lang-option.active .auth-lang-check {
    opacity: 1;
    transform: scale(1);
}

/* Animation for options */
.auth-lang-dropdown.show .auth-lang-option {
    animation: langOptionSlide 0.3s ease-out backwards;
}

.auth-lang-dropdown.show .auth-lang-option:nth-child(1) {
    animation-delay: 0.05s;
}

.auth-lang-dropdown.show .auth-lang-option:nth-child(2) {
    animation-delay: 0.1s;
}

.auth-lang-dropdown.show .auth-lang-option:nth-child(3) {
    animation-delay: 0.15s;
}

@keyframes langOptionSlide {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Dark mode adjustments */
[data-bs-theme="dark"] .auth-lang-dropdown {
    background: #1E293B;
    border-color: #334155;
    box-shadow:
        0 10px 40px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.05);
}

[data-bs-theme="dark"] .auth-lang-dropdown-header {
    background: linear-gradient(135deg, #0F172A 0%, #1E293B 100%);
    border-color: #334155;
}

[data-bs-theme="dark"] .auth-lang-option:hover {
    background: #334155;
}

[data-bs-theme="dark"] .auth-lang-option.active {
    background: var(--auth-primary-light);
}

/* Responsive adjustments */
@media (max-width: 480px) {
    .auth-lang-trigger {
        min-width: auto;
        padding: 0.5rem 0.75rem;
    }

    .auth-lang-trigger span {
        display: none;
    }

    .auth-lang-dropdown {
        min-width: 180px;
        left: 50%;
        transform: translateX(-50%) translateY(10px) scale(0.95);
    }

    .auth-lang-dropdown.show {
        transform: translateX(-50%) translateY(0) scale(1);
    }
}

