/* Ultra-Animated Authentication Theme - ALL OUT! */

/* ============================================================================
   CSS Variables for theming (light/dark mode)
   ============================================================================ */
:root {
    /* Calmer palette inspired by homepage */
    --bg-primary: radial-gradient(circle at 20% 20%, rgba(79, 209, 197, 0.08), transparent 30%),
                  radial-gradient(circle at 80% 0%, rgba(125, 220, 255, 0.12), transparent 25%),
                  linear-gradient(135deg, #0a0e1b 0%, #0d1226 60%, #0b1021 100%);
    --bg-overlay: rgba(13, 18, 38, 0.82);
    --bg-card: rgba(255, 255, 255, 0.04);
    --text-primary: #e8edf6;
    --text-secondary: #c9d4e6;
    --border-color: rgba(255, 255, 255, 0.08);
    --accent-color: #2de1a2;
    --accent-hover: #22c1c3;
    --accent-gradient: linear-gradient(135deg, #22c1c3 0%, #2de1a2 100%);
    --input-bg: rgba(255, 255, 255, 0.06);
    --input-border: rgba(255, 255, 255, 0.12);
    --input-focus: #7bdcff;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.35);
    --shadow-md: 0 8px 20px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 18px 50px rgba(0, 0, 0, 0.45);
    --shadow-xl: 0 28px 80px rgba(0, 0, 0, 0.55);
    --error-color: #f56565;
    --success-color: #48bb78;
    --glow-color: rgba(45, 225, 162, 0.18);
    --particle-color-1: rgba(45, 225, 162, 0.45);
    --particle-color-2: rgba(125, 220, 255, 0.35);
    --particle-color-3: rgba(232, 237, 246, 0.25);
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg-overlay: rgba(10, 14, 27, 0.9);
    }
}

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

body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, 
                 'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 
                 'Noto Color Emoji', 'Vazirmatn', 'Tahoma';
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ============================================================================
   Modern Auth Body Layout with LOTS of animations
   ============================================================================ */
.modern-auth-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: var(--bg-primary);
    background-size: cover;
    position: relative;
    overflow: hidden;
}

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

/* Floating particles effect */
@keyframes float {
    0%, 100% {
        transform: translateY(0) translateX(0) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100vh) translateX(50px) rotate(360deg);
        opacity: 0;
    }
}

@keyframes floatReverse {
    0%, 100% {
        transform: translateY(0) translateX(0) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100vh) translateX(-50px) rotate(-360deg);
        opacity: 0;
    }
}

/* ============================================================================
   Auth Card Container with extreme animations
   ============================================================================ */
.auth-card {
    width: 100%;
    max-width: 30rem; /* 480px */
    background-color: var(--bg-card);
    border-radius: 1.25rem; /* 20px */
    padding: 2.5rem 2.25rem;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    background-clip: padding-box;
    position: relative;
    z-index: 1;
    backdrop-filter: blur(12px);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* ============================================================================
   Auth Logo/Brand with extreme effects
   ============================================================================ */
.auth-logo {
    text-align: center;
    font-size: 2.75rem; /* 44px */
    font-weight: 900;
    background: var(--accent-gradient);
    background-size: 120% 120%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
    letter-spacing: -0.05em;
    line-height: 1.2;
    filter: drop-shadow(0 4px 10px rgba(45, 225, 162, 0.15));
}

/* ============================================================================
   Auth Title with animations
   ============================================================================ */
.auth-title {
    text-align: center;
    font-size: 1.875rem; /* 30px */
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 2rem;
    line-height: 1.4;
    position: relative;
}

/* ============================================================================
   Form Elements with extreme animations
   ============================================================================ */
.input-group {
    margin-bottom: 1.75rem; /* 28px */
    position: relative;
}

.input-field {
    width: 100%;
    padding: 1.125rem 1.5rem; /* 18px 24px */
    font-size: 1.0625rem; /* 17px */
    line-height: 1.5;
    color: var(--text-primary);
    background-color: var(--input-bg);
    border: 2px solid var(--input-border);
    border-radius: 0.875rem; /* 14px */
    outline: none;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    font-family: inherit;
    position: relative;
}

.input-field::placeholder {
    color: var(--text-secondary);
    opacity: 0.7;
    transition: all 0.3s ease;
}

/* Extreme focus states with multiple effects */
.input-field:focus {
    border-color: var(--input-focus);
    background-color: var(--bg-card);
    box-shadow: 0 0 0 3px var(--glow-color), 0 10px 25px rgba(0, 0, 0, 0.35);
}

.input-field:focus::placeholder {
    transform: translateX(10px);
    opacity: 0.4;
}

.input-field:focus-visible {
    outline: none;
}

.input-field:hover:not(:focus) {
    border-color: var(--accent-color);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

/* Animated label effect */
.input-group::before {
    content: attr(data-label);
    position: absolute;
    top: -10px;
    left: 20px;
    padding: 0 8px;
    background: var(--bg-overlay);
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 600;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
    pointer-events: none;
}

.input-field:focus ~ .input-group::before {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================================================
   Error Messages with animations
   ============================================================================ */
.input-error-message {
    display: block;
    margin-top: 0.75rem;
    font-size: 0.9375rem; /* 15px */
    color: var(--error-color);
    font-weight: 600;
    animation: errorShake 0.5s ease, errorFadeIn 0.3s ease;
    padding: 0.5rem 0.75rem;
    background: rgba(245, 101, 101, 0.1);
    border-left: 3px solid var(--error-color);
    border-radius: 0.375rem;
}

@keyframes errorShake {
    0%, 100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-8px);
    }
    75% {
        transform: translateX(8px);
    }
}

@keyframes errorFadeIn {
    0% {
        opacity: 0;
        transform: translateY(-10px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================================================
   Session Status Messages with extreme animations
   ============================================================================ */
.mb-4 {
    margin-bottom: 1.75rem;
    padding: 1.125rem 1.25rem;
    border-radius: 0.875rem;
    background: linear-gradient(135deg, rgba(72, 187, 120, 0.15) 0%, rgba(56, 178, 172, 0.15) 100%);
    border: 2px solid rgba(72, 187, 120, 0.4);
    font-weight: 600;
    box-shadow: 0 6px 18px rgba(72, 187, 120, 0.25);
    position: relative;
    overflow: hidden;
}

.mb-4::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: none;
}

/* ============================================================================
   Remember Me & Form Row with animations
   ============================================================================ */
.form-row {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    margin-bottom: 1.75rem;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1rem; /* 16px */
    color: var(--text-primary);
    cursor: pointer;
    user-select: none;
    font-weight: 600;
    transition: all 0.3s ease;
    padding: 0.5rem;
    border-radius: 0.5rem;
}

.remember-me:hover {
    color: var(--accent-color);
    background: rgba(45, 225, 162, 0.08);
    transform: translateX(4px);
}

.remember-me input[type="checkbox"] {
    width: 1.375rem; /* 22px */
    height: 1.375rem;
    cursor: pointer;
    accent-color: var(--accent-color);
    border-radius: 0.375rem;
    transition: all 0.3s ease;
}

.remember-me input[type="checkbox"]:checked {
    animation: checkboxBounce 0.4s ease;
}

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

.remember-me input[type="checkbox"]:focus-visible {
    outline: 2px solid var(--input-focus);
    outline-offset: 3px;
    box-shadow: 0 0 0 5px var(--glow-color);
}

/* ============================================================================
   Submit Button with EXTREME animations
   ============================================================================ */
.btn-submit {
    width: 100%;
    padding: 1.125rem 2rem; /* 18px 32px */
    font-size: 1.125rem; /* 18px */
    font-weight: 700;
    color: #ffffff;
    background: var(--accent-gradient);
    background-size: 140% 140%;
    border: none;
    border-radius: 0.875rem; /* 14px */
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-position 0.3s ease;
    min-height: 52px;
    box-shadow: 0 14px 35px rgba(45, 225, 162, 0.25);
    position: relative;
    overflow: hidden;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.btn-submit:hover {
    transform: translateY(-3px);
    box-shadow: 0 18px 40px rgba(34, 193, 195, 0.3);
    background-position: 100% 50%;
}

.btn-submit:active {
    transform: translateY(-1px);
    box-shadow: 0 12px 24px rgba(34, 193, 195, 0.25);
}

.btn-submit:focus-visible {
    outline: none;
    box-shadow: 0 0 0 4px var(--glow-color), 0 12px 28px rgba(34, 193, 195, 0.4);
}

/* ============================================================================
   Separator with animation
   ============================================================================ */
.separator {
    margin: 2.5rem 0;
    border: none;
    height: 2px;
    background: linear-gradient(to left, transparent, var(--accent-color), transparent);
    position: relative;
    animation: none;
}

.separator::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--accent-gradient);
    transform: translateY(-50%);
}

/* ============================================================================
   Register Link with extreme animations
   ============================================================================ */
.register-link {
    text-align: center;
    font-size: 1rem; /* 16px */
    color: var(--text-secondary);
    font-weight: 600;
}

.auth-link {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 700;
    transition: color 0.2s ease, transform 0.2s ease;
    position: relative;
    padding: 0.25rem 0.5rem;
    display: inline-block;
}

/* Multi-layered underline animation */
.auth-link::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 2px;
    bottom: 0;
    left: 0;
    background: var(--accent-gradient);
    transform: scaleX(1);
    transform-origin: center;
    opacity: 0.35;
    transition: opacity 0.2s ease;
}

.auth-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 100%;
    top: 0;
    left: 0;
    background: linear-gradient(90deg, transparent, rgba(102, 126, 234, 0.1), transparent);
    transition: width 0.3s ease;
    z-index: -1;
}

.auth-link:hover::before {
    opacity: 0.7;
}

.auth-link:hover::after {
    width: 100%;
}

.auth-link:hover {
    color: var(--accent-hover);
    transform: translateY(-2px);
    text-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.auth-link:focus-visible {
    outline: 2px solid var(--input-focus);
    outline-offset: 4px;
    border-radius: 4px;
    box-shadow: 0 0 0 4px var(--glow-color);
}

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

/* Small mobile devices */
@media (max-width: 360px) {
    .auth-card {
        padding: 2.5rem 1.75rem;
    }
    
    .auth-logo {
        font-size: 2.25rem;
    }
    
    .auth-title {
        font-size: 1.625rem;
    }
}

/* Medium devices and up */
@media (min-width: 640px) {
    .modern-auth-body {
        padding: 2rem;
    }
    
    .auth-card {
        padding: 3.5rem 3rem;
    }
}

/* Large devices */
@media (min-width: 1024px) {
    .auth-card {
        max-width: 34rem; /* 544px */
    }
}

/* ============================================================================
   RTL-specific adjustments
   ============================================================================ */
[dir="rtl"] .form-row {
    justify-content: flex-start;
}

[dir="rtl"] .input-field:focus::placeholder {
    transform: translateX(-10px);
}

[dir="rtl"] .remember-me:hover {
    transform: translateX(-4px);
}

/* ============================================================================
   High Contrast Mode Support
   ============================================================================ */
@media (prefers-contrast: high) {
    .input-field {
        border-width: 3px;
    }
    
    .btn-submit {
        border: 3px solid transparent;
    }
}

/* ============================================================================
   Reduced Motion Support
   ============================================================================ */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .modern-auth-body::before,
    .modern-auth-body::after {
        animation: none;
    }
    
    .auth-logo,
    .btn-submit,
    .separator {
        animation: none !important;
    }
}

/* ============================================================================
   Print Styles
   ============================================================================ */
@media print {
    .modern-auth-body {
        background: white;
    }
    
    .modern-auth-body::before,
    .modern-auth-body::after {
        display: none;
    }
    
    .auth-card {
        box-shadow: none;
        border: 2px solid #000;
        animation: none;
    }
    
    .auth-card::before,
    .auth-card::after {
        display: none;
    }
}
