/* ===============================
    🔐 Authentication Pages Styling
================================ */

/* Base page styling - Infinity Loop Brand Design */
.auth-page {
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: 
        /* Infinity loop waves - top wave - reduced opacity to avoid foggy white */
        radial-gradient(ellipse 600px 300px at 25% 20%, 
            hsla(0, 0%, 95%, 0.4) 0%, 
            hsla(0, 0%, 85%, 0.25) 30%,
            hsla(0, 0%, 75%, 0.15) 50%,
            transparent 80%),
        /* Infinity loop waves - bottom wave */
        radial-gradient(ellipse 600px 300px at 75% 80%, 
            hsla(0, 0%, 95%, 0.4) 0%, 
            hsla(0, 0%, 85%, 0.25) 30%,
            hsla(0, 0%, 75%, 0.15) 50%,
            transparent 80%),
        /* Dark royal purple base - high saturation */
        linear-gradient(135deg, 
            hsl(285, 95%, 4%) 0%, 
            hsl(285, 90%, 6%) 25%, 
            hsl(285, 85%, 8%) 50%, 
            hsl(285, 90%, 6%) 75%, 
            hsl(285, 95%, 4%) 100%);
    position: relative;
    overflow: hidden;
}

/* Infinity Loop - Top Wave */
.auth-page::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        /* Top infinity wave - reduced opacity to avoid foggy white */
        radial-gradient(ellipse 700px 250px at 25% 15%, 
            hsla(0, 0%, 98%, 0.25) 0%, 
            hsla(0, 0%, 90%, 0.15) 25%,
            hsla(0, 0%, 80%, 0.08) 50%,
            transparent 75%),
        /* Bottom infinity wave - reduced opacity to avoid foggy white */
        radial-gradient(ellipse 700px 250px at 75% 85%, 
            hsla(0, 0%, 98%, 0.25) 0%, 
            hsla(0, 0%, 90%, 0.15) 25%,
            hsla(0, 0%, 80%, 0.08) 50%,
            transparent 75%);
    animation: infinityWave 20s ease-in-out infinite;
    pointer-events: none;
    z-index: 1;
}

/* Add sophisticated depth with enhanced left-side visibility */
.auth-page {
    position: relative;
    box-shadow: 
        inset 0 0 200px hsla(51, 100%, 60%, 0.05),
        inset 0 0 100px hsla(285, 80%, 30%, 0.08),
        inset -200px 0 150px hsla(285, 80%, 25%, 0.12),
        inset -100px 0 100px hsla(51, 100%, 50%, 0.08);
}

/* Infinity Wave Animation */
@keyframes infinityWave {
    0%, 100% { 
        transform: translate(0, 0) scale(1); 
        opacity: 0.8;
    }
    25% { 
        transform: translate(30px, -20px) scale(1.1); 
        opacity: 0.9;
    }
    50% { 
        transform: translate(-20px, 30px) scale(0.9); 
        opacity: 0.7;
    }
    75% { 
        transform: translate(20px, -10px) scale(1.05); 
        opacity: 0.85;
    }
}

/* Subtle pulse for additional depth */
@keyframes subtlePulse {
    0%, 100% { 
        opacity: 0.3; 
        transform: scale(1);
    }
    50% { 
        opacity: 0.6; 
        transform: scale(1.5);
    }
}

/* Add a subtle mesh gradient overlay for extra elegance */
.auth-page {
    background-attachment: fixed;
}

/* Enhanced infinity loop using box-shadow */
.auth-page {
    position: relative;
    box-shadow: none;
}

/* Main container */
.auth-container {
    background: 
        linear-gradient(135deg, 
            rgba(255, 255, 255, 0.95) 0%, 
            rgba(255, 255, 255, 0.9) 100%);
    backdrop-filter: blur(15px) saturate(0.8);
    border-radius: var(--border-radius-2xl);
    box-shadow: 
        0 25px 50px rgba(0, 0, 0, 0.15),
        0 0 0 1px rgba(255, 255, 255, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.4),
        0 0 100px hsla(51, 100%, 60%, 0.1);
    padding: var(--spacing-5xl) var(--spacing-4xl);
    width: 100%;
    max-width: 450px;
    margin: var(--spacing-3xl);
    position: relative;
    z-index: 10;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.auth-container:hover {
    box-shadow: 
        0 35px 70px rgba(0, 0, 0, 0.2),
        0 0 0 1px rgba(255, 255, 255, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.5),
        0 0 120px hsla(51, 100%, 60%, 0.15);
    backdrop-filter: blur(30px) saturate(1.3);
}

/* Dark mode adjustments - based on browser preferences */
@media (prefers-color-scheme: dark) {
    .auth-container {
        background: 
            linear-gradient(135deg, 
                rgba(18, 18, 18, 0.95) 0%, 
                rgba(25, 25, 25, 0.9) 100%);
        color: var(--text-dark);
        box-shadow: 
            0 25px 50px rgba(0, 0, 0, 0.4),
            0 0 0 1px rgba(255, 255, 255, 0.1),
            inset 0 1px 0 rgba(255, 255, 255, 0.1),
            0 0 100px hsla(285, 80%, 20%, 0.2);
        border: 1px solid rgba(255, 255, 255, 0.1);
    }

    .auth-container:hover {
        box-shadow: 
            0 35px 70px rgba(0, 0, 0, 0.5),
            0 0 0 1px rgba(255, 255, 255, 0.15),
            inset 0 1px 0 rgba(255, 255, 255, 0.15),
            0 0 120px hsla(285, 80%, 25%, 0.3);
    }
}

/* Logo section */
.auth-logo {
    text-align: center;
    margin-bottom: var(--spacing-3xl);
    position: relative;
}

.auth-logo img {
    max-width: 120px;
    height: auto;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
    transition: all 0.3s ease;
}

.auth-logo img:hover {
    transform: scale(1.05);
    filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.15));
}

/* Page title */
.auth-title {
    text-align: center;
    margin-bottom: 0.5rem;
    font-size: var(--font-size-4xl);
    font-weight: var(--font-weight-bold);
    color: var(--color-primary);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Subtitle */
.auth-subtitle {
    text-align: center;
    margin-bottom: var(--spacing-3xl);
    color: var(--text-muted);
    font-size: var(--font-size-sm);
    line-height: 1.5;
}

@media (prefers-color-scheme: dark) {
    .auth-title {
        color: var(--text-dark);
    }
    
    .auth-subtitle {
        color: var(--text-subtle);
    }
}

/* Form styling */
.auth-form {
    width: 100%;
}

.auth-form label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: var(--font-weight-semibold);
    color: var(--text-slightly-primary);
    font-size: var(--font-size-sm);
}

.auth-form input {
    width: 100%;
    padding: var(--spacing-lg) var(--spacing-xl);
    border: 2px solid var(--border-subtle);
    border-radius: var(--border-radius-lg);
    font-size: var(--font-size-base);
    background: rgba(255, 255, 255, 0.8);
    color: var(--color-text);
    transition: all 0.3s ease;
    margin-bottom: var(--spacing-2xl);
    box-sizing: border-box;
}

.auth-form input:focus {
    outline: none;
    border-color: var(--color-cta);
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 0 0 4px var(--cta-subtle);
    transform: translateY(-2px);
}

.auth-form input:invalid:not(:placeholder-shown) {
    border-color: var(--color-danger);
    background: var(--danger-subtle);
}

@media (prefers-color-scheme: dark) {
    .auth-form label {
        color: var(--text-dark);
    }
    
    .auth-form input {
        background: rgba(18, 18, 18, 0.8);
        border-color: var(--border-muted);
        color: var(--text-dark);
    }

    .auth-form input:focus {
        background: rgba(18, 18, 18, 0.95);
        border-color: var(--color-cta);
    }
}

/* Button styling */
.auth-button {
    /* Inherits base button styles from vxs.css */
    /* Inherits global button flash effect */
    width: 100%;
    padding: var(--spacing-lg) var(--spacing-3xl);
    background: var(--color-primary);
    color: var(--button-text-color);
    border: 1px solid var(--color-primary);
    border-radius: var(--border-radius-lg);
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-semibold);
    margin-bottom: var(--spacing-2xl);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.auth-button:hover {
    /* Inherits hover styles from base button */
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.auth-button img {
    width: 1.25rem;
    height: 1.25rem;
    filter: brightness(0) invert(1);
}

/* Secondary button */
.auth-secondary-button {
    /* Inherits base button styles from vxs.css */
    /* Inherits global button flash effect */
    width: 100%;
    padding: 0.75rem 2rem;
    background: transparent;
    color: var(--color-primary);
    border: 1px solid var(--border-medium);
    border-radius: var(--border-radius-lg);
    font-size: var(--font-size-base);
    font-weight: 500;
    margin-bottom: 1rem;
}

.auth-secondary-button:hover {
    /* Inherits hover styles from base button */
    transform: translateY(-2px);
    background: var(--primary-subtle);
    border-color: var(--color-primary);
    color: var(--color-primary);
}

/* Dark mode styles now handled by dynamic CSS variables */

/* Message styling */
.auth-message {
    padding: 1rem;
    border-radius: 0.75rem;
    margin-bottom: var(--spacing-2xl);
    font-size: var(--font-size-sm);
    text-align: center;
    font-weight: 500;
}

.auth-message.error {
    background: var(--danger-subtle);
    color: var(--color-danger);
    border: 1px solid var(--danger-border);
}

.auth-message.success {
    background: var(--success-subtle);
    color: var(--color-success);
    border: 1px solid var(--success-border);
}

/* Dark mode message styles now handled by dynamic CSS variables */

/* Link styling */
.auth-link {
    text-align: center;
    margin-top: 1.5rem;
    color: var(--text-muted);
    font-size: var(--font-size-sm);
}

.auth-link a {
    color: var(--color-primary);
    text-decoration: none;
    font-weight: var(--font-weight-semibold);
    transition: color 0.3s ease;
}

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

/* Dark mode link styles now handled by dynamic CSS variables */

/* Logout specific styling */
.logout-container {
    text-align: center;
    padding: 3rem 2rem;
}

.logout-icon {
    margin-bottom: var(--spacing-3xl);
}

.logout-icon img {
    width: 100px;
    height: auto;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
    animation: pulse 2s ease-in-out infinite;
}

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

.logout-title {
    font-size: 2.5rem;
    font-weight: var(--font-weight-bold);
    color: var(--color-primary);
    margin-bottom: 1rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.logout-message {
    font-size: var(--font-size-lg);
    color: var(--text-muted);
    margin-bottom: var(--spacing-3xl);
    line-height: 1.6;
}

/* Dark mode logout styles now handled by dynamic CSS variables */

/* Responsive design */
@media (max-width: 768px) {
    .auth-container {
        margin: 1rem;
        padding: 2rem 1.5rem;
        border-radius: 1.5rem;
    }
    
    .auth-title {
        font-size: 1.75rem;
    }
    
    .auth-logo img {
        max-width: 100px;
    }
    
    .logout-icon img {
        width: 80px;
    }
    
    .logout-title {
        font-size: var(--font-size-4xl);
    }
}

@media (max-width: 480px) {
    .auth-container {
        margin: 0.5rem;
        padding: 1.5rem 1rem;
    }
    
    .auth-title {
        font-size: 1.5rem;
    }
    
    .auth-logo img {
        max-width: 80px;
    }
    
    .logout-icon img {
        width: 60px;
    }
    
    .logout-title {
        font-size: 1.75rem;
    }
}

/* Loading state and disabled button handling */
.auth-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    pointer-events: none;
}

.auth-button:disabled:hover {
    transform: none;
    box-shadow: none;
}

/* Prevent all interactions with disabled buttons */
.auth-button:disabled,
.auth-button:disabled:hover,
.auth-button:disabled:active,
.auth-button:disabled:focus {
    pointer-events: none;
    cursor: not-allowed;
}

/* Form validation states */
.auth-form:has(:invalid) .auth-button {
    opacity: 0.6;
    pointer-events: none;
    cursor: not-allowed;
}

.auth-form:has(:invalid) .auth-button:hover {
    transform: none;
    box-shadow: none;
}
