
/* Animated Background - Cosmic Theme */
body {
    position: relative;
    min-height: 100vh;
    max-height: 100vh;
    overflow: auto;
    background: #000428;
    background: -webkit-linear-gradient(to right, #004e92, #000428);
    background: linear-gradient(to right, #004e92, #000428);
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    color: #ffffff;
    box-sizing: border-box;
}

.flag-vn {
    position: fixed;
    top: 18px;
    left: 18px;
    width: 60px;
    height: 40px;
    z-index: 1001;
    pointer-events: none;
}
.flag-vn .flag-element {
    /* Animation và style gốc từ bài viết, chỉ chỉnh lại size cho phù hợp */
    -webkit-animation: oscill 1s ease-in-out infinite alternate;
    -moz-animation: oscill 1s ease-in-out infinite alternate;
    -ms-animation: oscill 1s ease-in-out infinite alternate;
    animation: oscill 1s ease-in-out infinite alternate;
    background: url('https://upload.wikimedia.org/wikipedia/commons/2/21/Flag_of_Vietnam.svg');
    background-size: 60px 100%;
    position: relative;
    height: 100%;
    width: 1px;
    display: inline-block;
    /*box-shadow: 0 1px #888, 0 -1px #aaa;*/
}
@-webkit-keyframes oscill {
    0% { top: 5%; }
    100% { top: -5%; }
}
@-moz-keyframes oscill {
    0% { top: 5%; }
    100% { top: -5%; }
}
@-ms-keyframes oscill {
    0% { top: 5%; }
    100% { top: -5%; }
}
@keyframes oscill {
    0% { top: 5%; }
    100% { top: -5%; }
}
/* Glass Morphism Effect */
.glass-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

.glass-circle {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    animation: floatAnimation 25s infinite ease-in-out;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.circle-1 {
    width: 500px;
    height: 500px;
    left: -150px;
    top: -150px;
    background: radial-gradient(circle at center, rgba(103, 232, 249, 0.12), rgba(103, 232, 249, 0.04));
}

.circle-2 {
    width: 400px;
    height: 400px;
    right: -120px;
    bottom: -120px;
    background: radial-gradient(circle at center, rgba(147, 51, 234, 0.12), rgba(147, 51, 234, 0.04));
}

.circle-3 {
    width: 250px;
    height: 250px;
    right: 35%;
    top: 25%;
    background: radial-gradient(circle at center, rgba(59, 130, 246, 0.12), rgba(59, 130, 246, 0.04));
    animation-delay: -8s;
}

/* Enhanced Light Streaks */
.light-streak {
    position: absolute;
    width: 1px;
    background: linear-gradient(to bottom, transparent, rgba(103, 232, 249, 0.4), transparent);
    animation: streakAnimation 12s infinite linear;
    border-radius: 50%;
}

.light-streaks::before {
    content: '';
    position: absolute;
    width: 1px;
    height: 100px;
    background: linear-gradient(to bottom, transparent, rgba(147, 51, 234, 0.3), transparent);
    animation: streakAnimation 15s infinite linear;
    animation-delay: -5s;
    left: 25%;
}

.light-streaks::after {
    content: '';
    position: absolute;
    width: 1px;
    height: 80px;
    background: linear-gradient(to bottom, transparent, rgba(59, 130, 246, 0.3), transparent);
    animation: streakAnimation 18s infinite linear;
    animation-delay: -10s;
    right: 30%;
}

/* Moving Stars */
.stars {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
}

/* Stars Effect */
.star {
    position: absolute;
    width: 2px;
    height: 2px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    animation: twinkle 3s infinite ease-in-out;
    box-shadow: 0 0 4px rgba(255, 255, 255, 0.5);
}

/* Enhanced Aurora Effect */
.aurora {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    opacity: 0.3;
    background: 
        linear-gradient(
            45deg,
            transparent 0%,
            rgba(103, 232, 249, 0.1) 25%,
            rgba(147, 51, 234, 0.08) 50%,
            rgba(59, 130, 246, 0.1) 75%,
            transparent 100%
        );
    animation: auroraAnimation 30s infinite;
}

/* Animations */
@keyframes floatAnimation {
    0%, 100% {
        transform: translate(0, 0) rotate(0deg);
    }
    25% {
        transform: translate(2%, 2%) rotate(5deg);
    }
    50% {
        transform: translate(-2%, 4%) rotate(-5deg);
    }
    75% {
        transform: translate(-1%, -2%) rotate(3deg);
    }
}

@keyframes streakAnimation {
    0% {
        transform: translateY(-100%) translateX(-100%) rotate(45deg);
        height: 50vh;
        opacity: 0;
    }
    50% {
        opacity: 0.5;
    }
    100% {
        transform: translateY(100%) translateX(100%) rotate(45deg);
        height: 50vh;
        opacity: 0;
    }
}

@keyframes twinkle {
    0%, 100% {
        opacity: 0.3;
        transform: scale(0.3);
    }
    50% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes auroraAnimation {
    0%, 100% {
        transform: translateY(-20px) rotate(0deg);
    }
    50% {
        transform: translateY(20px) rotate(180deg);
    }
}
[data-theme="dark"] {
    --background: #0f172a;
    --foreground: #f8fafc;
    --gradient-background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    --gray-100: #1e293b;
    --gray-200: #334155;
    --gray-300: #475569;
    --gray-400: #64748b;
    --gray-500: #94a3b8;
}

[data-theme="dark"] body {
    color: var(--foreground);
    background: var(--gradient-background);
}

[data-theme="dark"] .form-container {
    background: #1e293b;
    color: var(--foreground);
}

[data-theme="dark"] .form-header h2,
[data-theme="dark"] .form-header p {
    color: var(--foreground);
}

[data-theme="dark"] .input-group input {
    background-color: var(--gray-100);
    color: var(--foreground);
    border-color: var(--gray-300);
}

[data-theme="dark"] .input-group label {
    color: var(--gray-400);
    background-color: var(--gray-100);
}

[data-theme="dark"] .input-group input:focus + label,
[data-theme="dark"] .input-group input:not(:placeholder-shown) + label {
    color: var(--primary-light);
    background-color: var(--background);
}

[data-theme="dark"] .input-icon,
[data-theme="dark"] .password-toggle {
    color: var(--gray-400);
}

[data-theme="dark"] .btn-primary {
    color: #fff;
    background: var(--gradient-primary);
}

[data-theme="dark"] .form-footer,
[data-theme="dark"] .form-link,
[data-theme="dark"] .form-options,
[data-theme="dark"] .checkbox-container span {
    color: var(--foreground);
}

[data-theme="dark"] .strength-text {
    color: var(--gray-500);
}

[data-theme="dark"] .notification {
    background: rgba(30, 41, 59, 0.95);
    color: #f8fafc;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .notification.success { 
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
}

[data-theme="dark"] .notification.error { 
    background: linear-gradient(135deg, #ef4444, #b91c1c);
    color: white;
}

[data-theme="dark"] .notification.warning { 
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
}

[data-theme="dark"] .theme-switch {
    background: #1e293b;
    color: var(--foreground);
}

[data-theme="dark"] .stars .star {
    background: #f8fafc;
}

[data-theme="dark"] .glass-circle,
[data-theme="dark"] .aurora {
    background-blend-mode: lighten;
}

@media (max-width: 640px) {
    [data-theme="dark"] .notification {
        color: var(--foreground);
        background: #1e293b;
    }
}

/* Dark Theme Adjustments */
[data-theme="dark"] .circle-1 {
    background: radial-gradient(circle at center, rgba(139, 92, 246, 0.1), rgba(139, 92, 246, 0.05));
}

[data-theme="dark"] .circle-2 {
    background: radial-gradient(circle at center, rgba(236, 72, 153, 0.1), rgba(236, 72, 153, 0.05));
}

[data-theme="dark"] .circle-3 {
    background: radial-gradient(circle at center, rgba(34, 211, 238, 0.1), rgba(34, 211, 238, 0.05));
}
:root {
    --primary: #4f46e5;
    --primary-dark: #4338ca;
    --primary-light: #6366f1;
    --secondary: #0ea5e9;
    --success: #22c55e;
    --danger: #ef4444;
    --warning: #f59e0b;
    
    --background: #f8fafc;
    --foreground: #0f172a;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    
    --gradient-primary: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    --gradient-background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 20px 25px -5px rgb(0 0 0 / 0.1);
    
    --font-sans: 'Segoe UI', system-ui, -apple-system, sans-serif;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --radius: 0.5rem;
}

/* Dark Theme */
[data-theme="dark"] {
    --background: #0f172a;
    --foreground: #f8fafc;
    --gradient-background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    --gray-100: #1e293b;
    --gray-200: #334155;
    --gray-300: #475569;
    --gray-400: #64748b;
    --gray-500: #94a3b8;
}

/* Light Theme - More Balanced Colors */
[data-theme="light"] {
    --background: #ffffff;
    --foreground: #2d3748;
    --gradient-background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 50%, #e2e8f0 100%);
    --gray-100: #f7fafc;
    --gray-200: #edf2f7;
    --gray-300: #e2e8f0;
    --gray-400: #a0aec0;
    --gray-500: #718096;
}

/* Light Theme Body - Softer Background */
[data-theme="light"] body {
    background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 50%, #e2e8f0 100%);
    color: var(--foreground);
}

/* Light Theme Form Container - Better Balanced */
[data-theme="light"] .form-container {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 20px 40px -12px rgba(0, 0, 0, 0.15);
}

/* Light Theme Form Headers */
[data-theme="light"] .form-header h2,
[data-theme="light"] .form-header p {
    color: var(--foreground);
}

/* Light Theme Input Styles - Better Contrast */
[data-theme="light"] .input-group input {
    background-color: rgba(255, 255, 255, 0.95);
    color: var(--foreground);
    border-color: var(--gray-300);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .input-group label {
    color: var(--gray-500);
    background-color: rgba(255, 255, 255, 0.95);
}

[data-theme="light"] .input-group input:focus + label,
[data-theme="light"] .input-group input:not(:placeholder-shown) + label {
    color: #3182ce;
    background-color: var(--background);
}

[data-theme="light"] .input-icon,
[data-theme="light"] .password-toggle {
    color: var(--gray-400);
}

/* Light Theme Button - More Balanced Colors */
[data-theme="light"] .btn-primary {
    background: linear-gradient(135deg, #3182ce 0%, #2b77cb 100%);
    color: #ffffff;
    box-shadow: 0 4px 12px 0 rgba(49, 130, 206, 0.35);
    border: 1px solid rgba(49, 130, 206, 0.3);
}

[data-theme="light"] .btn-primary:hover {
    background: linear-gradient(135deg, #2c5aa0 0%, #2a69ac 100%);
    box-shadow: 0 6px 18px 0 rgba(49, 130, 206, 0.45);
    transform: translateY(-1px);
}

/* Light Theme Text Elements */
[data-theme="light"] .form-footer,
[data-theme="light"] .form-link,
[data-theme="light"] .form-options,
[data-theme="light"] .checkbox-container span {
    color: var(--foreground);
}

[data-theme="light"] .form-link {
    color: var(--primary);
}

[data-theme="light"] .strength-text {
    color: var(--gray-500);
}

/* Light Theme Notification */
[data-theme="light"] .notification {
    background: rgba(255, 255, 255, 0.95);
    color: #1e293b;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .notification.success { 
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
}

[data-theme="light"] .notification.error { 
    background: linear-gradient(135deg, #ef4444, #b91c1c);
    color: white;
}

[data-theme="light"] .notification.warning { 
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
}

/* Light Theme Background Elements */
[data-theme="light"] .glass-circle {
    opacity: 0.4;
}

[data-theme="light"] .circle-1 {
    background: radial-gradient(circle at center, rgba(79, 70, 229, 0.15), rgba(79, 70, 229, 0.05));
}

[data-theme="light"] .circle-2 {
    background: radial-gradient(circle at center, rgba(14, 165, 233, 0.15), rgba(14, 165, 233, 0.05));
}

[data-theme="light"] .circle-3 {
    background: radial-gradient(circle at center, rgba(34, 197, 94, 0.15), rgba(34, 197, 94, 0.05));
}

[data-theme="light"] .aurora {
    opacity: 0.3;
    background: linear-gradient(45deg, rgba(79, 70, 229, 0.1), rgba(14, 165, 233, 0.1), rgba(34, 197, 94, 0.1));
}

[data-theme="light"] .stars .star {
    background: #64748b;
    opacity: 0.6;
}

/* Base Styles */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}



/* Auth Container */
.auth-container {
    width: 100%;
    max-width: 28rem;
    max-height: calc(100vh - 2rem);
    perspective: 1000px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Form Container - Cosmic Glass Morphism */
.form-container {
    display: none;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 2rem;
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), 
                0 0 0 1px rgba(255, 255, 255, 0.2);
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.18);
    width: 100%;
    max-height: calc(100vh - 2rem);
    box-sizing: border-box;
}

.form-container.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
    animation: formAppear 0.3s ease-out;
}

/* Enhanced Form Loading State */
.form-container.loading {
    position: relative;
    pointer-events: none; /* Prevent all interactions */
    opacity: 0.7;
}

.form-container.loading::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border-radius: inherit;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}

.form-container.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 32px;
    height: 32px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top: 3px solid #4f46e5;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    transform: translate(-50%, -50%);
    z-index: 11;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Dark theme loading state */
[data-theme="dark"] .form-container.loading::before {
    background: rgba(30, 41, 59, 0.8);
}

[data-theme="dark"] .form-container.loading::after {
    border-color: rgba(248, 250, 252, 0.3);
    border-top-color: #60a5fa;
}

/* Light theme loading state */
[data-theme="light"] .form-container.loading::before {
    background: rgba(248, 250, 252, 0.9);
}

[data-theme="light"] .form-container.loading::after {
    border-color: rgba(15, 23, 42, 0.3);
    border-top-color: #4f46e5;
}

@keyframes formAppear {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Form Header - Enhanced Cosmic Theme */
.form-header {
    text-align: center;
    margin-bottom: 2rem;
}

.form-header h2 {
    font-size: 1.875rem;
    color: #ffffff;
    margin-bottom: 0.5rem;
    font-weight: 700;
    text-shadow: 0 0 20px rgba(103, 232, 249, 0.3);
}

.form-header::after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, rgba(103, 232, 249, 1), rgba(147, 51, 234, 1));
    margin: 1rem auto 0;
    border-radius: 2px;
    box-shadow: 0 0 10px rgba(103, 232, 249, 0.5);
}

.form-header p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.975rem;
}

/* Input Group */
.form-group {
    margin-bottom: 1.5rem;
}

.input-group {
    position: relative;
}

.input-group input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    font-size: 1rem;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    background-color: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #ffffff;
    transition: all 0.3s ease;
    outline: none;
}

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

.input-group input:focus {
    border-color: rgba(103, 232, 249, 0.8);
    box-shadow: 0 0 20px rgba(103, 232, 249, 0.3);
    background-color: rgba(255, 255, 255, 0.15);
}

.input-group label {
    position: absolute;
    left: 2.5rem;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.7);
    transition: all 0.3s ease;
    pointer-events: none;
    font-weight: 500;
}

.input-group input:not(:placeholder-shown) {
    padding-top: 1.25rem;
    padding-bottom: 0.25rem;
}

.input-group input:focus + label,
.input-group input:not(:placeholder-shown) + label {
    transform: translateY(-130%) scale(0.85);
    left: 0.75rem;
    color: rgba(103, 232, 249, 1);
    font-weight: 600;
}

/* Select Dropdown Styles */
.input-group select {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    font-size: 1rem;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    background-color: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #ffffff;
    transition: all 0.3s ease;
    outline: none;
    cursor: pointer;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='rgba(255,255,255,0.7)' 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 0.75rem center;
    background-size: 1rem;
}

.input-group select:focus {
    border-color: rgba(103, 232, 249, 0.8);
    box-shadow: 0 0 20px rgba(103, 232, 249, 0.3);
    background-color: rgba(255, 255, 255, 0.15);
}

.input-group select option {
    background-color: rgba(30, 30, 50, 0.95);
    color: #ffffff;
    padding: 0.5rem;
}

.input-group select:focus + label,
.input-group select:valid + label {
    transform: translateY(-130%) scale(0.85);
    left: 0.75rem;
    color: rgba(103, 232, 249, 1);
    font-weight: 600;
}

/* Icons - Cosmic Theme */
.input-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.25rem !important;
}

/* Password Toggle */
.password-toggle {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    padding: 0.25rem;
    transition: color 0.3s ease;
}

.password-toggle:hover {
    color: rgba(103, 232, 249, 1);
}

/* Buttons - Cosmic Theme */
.btn {
    width: 100%;
    padding: 0.875rem 1.5rem;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: linear-gradient(135deg, rgba(103, 232, 249, 0.8) 0%, rgba(147, 51, 234, 0.8) 100%);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 25px rgba(103, 232, 249, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 35px rgba(103, 232, 249, 0.4);
    background: linear-gradient(135deg, rgba(103, 232, 249, 1) 0%, rgba(147, 51, 234, 1) 100%);
}

.btn-primary::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: left 0.5s;
}

.btn-primary:hover::before {
    left: 100%;
}

/* Loading State - GitHub Style */
.btn-loader {
    display: none;
    width: 1rem;
    height: 1rem;
    border: 2px solid rgba(255, 255, 255, 0.25);
    border-radius: 50%;
    border-top-color: #ffffff;
    animation: spin 0.6s linear infinite;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.btn.loading {
    position: relative;
    pointer-events: none;
    cursor: wait;
}

.btn.loading .btn-loader {
    display: block;
}

.btn.loading .btn-text {
    opacity: 0.7;
}

/* Checkbox - Cosmic Theme */
.checkbox-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.9);
}

.checkbox-container input {
    width: 1.25rem;
    height: 1.25rem;
    margin: 0;
}

/* Links - Cosmic Theme */
.form-link {
    color: rgba(103, 232, 249, 1);
    text-decoration: none;
    transition: all 0.3s ease;
}

.form-link:hover {
    color: rgba(147, 51, 234, 1);
    text-shadow: 0 0 8px rgba(103, 232, 249, 0.6);
}

/* Form Footer */
.form-footer {
    text-align: center;
    margin-top: 1.5rem;
    color: rgba(255, 255, 255, 0.9);
}

.footer-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.footer-row .forgot-password,
.footer-row .form-link {
    font-size: 0.9rem;
    color: #60a5fa;
    text-decoration: none;
    transition: all 0.3s ease;
}

.footer-row .forgot-password:hover,
.footer-row .form-link:hover {
    color: #3b82f6;
    text-decoration: underline;
}

.form-options {
    margin-bottom: 1.5rem;
    color: rgba(255, 255, 255, 0.9);
}

/* Password Strength */
.password-strength {
    margin-top: 0.5rem;
}

.strength-meter {
    height: 4px;
    background: var(--gray-200);
    border-radius: var(--radius);
    overflow: hidden;
}

.strength-meter div {
    height: 100%;
    width: 0;
    transition: var(--transition);
}

/* Notification */
.notification {
    position: fixed;
    top: 2rem;
    left: 1rem;
    right: 1rem;
    z-index: 10000;
    padding: 1rem;
    border-radius: 12px;
    font-weight: 600;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.2), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    transform: translateY(-20px);
    opacity: 0;
    transition: all 0.3s ease;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    max-width: 350px;
    min-width: 250px;
    word-wrap: break-word;
    display: flex;
    align-items: center;
    gap: 12px;
    line-height: 1.5;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.notification.hidden {
    display: none;
}

.notification.show {
    transform: translateY(0);
    opacity: 1;
}

.notification.success { 
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
}

.notification.error { 
    background: linear-gradient(135deg, #ef4444, #b91c1c);
    color: white;
}

.notification.warning { 
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
}

.notification-message {
    line-height: 1.4;
    font-size: 0.9rem;
}

.notification-icon {
    font-weight: bold;
    font-size: 1rem;
}

/* Theme Switch */
.theme-switch {
    position: fixed;
    top: 1rem;
    right: 1rem;
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    background: white;
    box-shadow: var(--shadow);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-500);
    transition: var(--transition);
}

.theme-switch:hover {
    transform: rotate(45deg);
    color: var(--primary);
}

/* Animations */
@keyframes spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Enhanced Mobile Responsiveness */
@media (max-width: 768px) {
    body {
        padding: 0.75rem;
        min-height: 100vh;
        min-height: 100svh; /* Use small viewport height for mobile */
        background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 50%, #e2e8f0 100%);
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .auth-container {
        max-width: 100%;
        margin: 0;
        width: 100%;
        max-height: 100vh;
        min-height: auto;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0.5rem;
    }
    
    .form-container {
        padding: 1.5rem;
        margin: 0;
        border-radius: 16px;
        min-height: auto;
        max-height: calc(100vh - 1rem);
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
        background: rgba(255, 255, 255, 0.95);
        border: 1px solid rgba(226, 232, 240, 0.6);
        box-shadow: 
            0 16px 32px rgba(0, 0, 0, 0.1),
            inset 0 1px 0 rgba(255, 255, 255, 0.1);
        width: 100%;
        max-width: 400px;
        position: relative;
    }

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

    .form-header h2 {
        font-size: 1.75rem;
        margin-bottom: 0.5rem;
        font-weight: 600;
        color: #2d3748;
        text-shadow: none;
    }

    .form-header .form-subtitle {
        font-size: 0.875rem;
        color: #718096;
        margin-top: 0.5rem;
        line-height: 1.5;
    }

    .form-group {
        margin-bottom: 1.25rem;
    }

    .input-group {
        position: relative;
        margin-bottom: 0;
    }

    .input-group input,
    .input-group select {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 0.875rem 1rem 0.875rem 2.75rem;
        min-height: 52px; /* Enhanced touch target */
        border-radius: 12px;
        background: rgba(255, 255, 255, 0.98);
        border: 2px solid rgba(226, 232, 240, 0.8);
        transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
        color: #2d3748;
        width: 100%;
        outline: none;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    }

    .input-group input:focus,
    .input-group select:focus {
        border-color: #3182ce;
        box-shadow: 
            0 0 0 3px rgba(49, 130, 206, 0.15),
            0 2px 8px rgba(0, 0, 0, 0.1);
        background: rgba(255, 255, 255, 1);
    }
    }

    .input-icon {
        position: absolute;
        left: 1rem;
        top: 50%;
        transform: translateY(-50%);
        font-size: 1.125rem !important;
        color: #a0aec0;
        transition: color 0.2s ease;
        z-index: 2;
    }

    .input-group:focus-within .input-icon {
        color: #3182ce;
    }

    .input-group label {
        position: absolute;
        left: 2.75rem;
        top: 50%;
        transform: translateY(-50%);
        font-size: 0.875rem;
        color: #718096;
        pointer-events: none;
        transition: all 0.2s ease;
        background: transparent;
        padding: 0;
        z-index: 1;
    }

    .input-group input:focus + label,
    .input-group input:not(:placeholder-shown) + label,
    .input-group select:focus + label,
    .input-group select:not([value=""]) + label {
        top: -0.5rem;
        left: 0.75rem;
        font-size: 0.75rem;
        color: #3182ce;
        background: rgba(255, 255, 255, 0.95);
        padding: 0 0.25rem;
        border-radius: 4px;
    }
    
    .btn {
        min-height: 52px; /* Enhanced touch target */
        font-size: 1rem;
        font-weight: 600;
        border-radius: 12px;
        padding: 0.875rem 1.5rem;
        background: linear-gradient(135deg, #3182ce, #2c5aa0);
        border: 1px solid rgba(49, 130, 206, 0.3);
        color: #ffffff;
        box-shadow: 
            0 2px 8px rgba(0, 0, 0, 0.1),
            inset 0 1px 0 rgba(255, 255, 255, 0.1);
        transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
        cursor: pointer;
        position: relative;
        overflow: hidden;
        margin: 1rem 0;
    }

    .btn:hover,
    .btn:focus {
        transform: translateY(-1px);
        box-shadow: 
            0 4px 16px rgba(0, 0, 0, 0.15),
            inset 0 1px 0 rgba(255, 255, 255, 0.15);
        background: linear-gradient(135deg, #2c5aa0, #2a4a84);
    }

    .btn:active {
        transform: translateY(0);
        box-shadow: 
            0 2px 8px rgba(0, 0, 0, 0.1),
            inset 0 1px 0 rgba(255, 255, 255, 0.1);
        transition: transform 0.1s ease;
    }

    /* Enhanced checkbox styling for mobile */
    .checkbox-container {
        margin: 1rem 0;
        display: flex;
        align-items: flex-start;
        gap: 0.75rem;
        padding: 0.5rem 0;
    }

    .checkbox-container input[type="checkbox"] {
        width: 20px;
        height: 20px;
        margin: 0;
        accent-color: #3182ce;
        border-radius: 4px;
        flex-shrink: 0;
        margin-top: 0.125rem;
    }

    .checkbox-container span {
        font-size: 0.875rem;
        line-height: 1.5;
        color: #2d3748;
        cursor: pointer;
        user-select: none;
    }

    .form-options {
        margin: 1rem 0 1.5rem 0;
    }

    .form-footer {
        text-align: center;
        padding: 1.5rem 0 0 0;
        border-top: 1px solid rgba(226, 232, 240, 0.5);
        margin-top: 1.5rem;
    }

    .form-footer p {
        font-size: 0.875rem;
        color: #718096;
        margin: 0;
    }

    .form-link {
        color: #3182ce;
        text-decoration: none;
        font-weight: 500;
        transition: color 0.2s ease;
    }

    .form-link:hover {
        color: #2c5aa0;
        text-decoration: underline;
    }
    
    .password-toggle {
        position: absolute;
        right: 1rem;
        top: 50%;
        transform: translateY(-50%);
        background: none;
        border: none;
        color: #a0aec0;
        cursor: pointer;
        padding: 0.25rem;
        font-size: 1.125rem;
        transition: color 0.2s ease;
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
        z-index: 2;
    }

    .password-toggle:hover {
        color: #2d3748;
    }

    .password-toggle:focus {
        outline: 2px solid #3182ce;
        outline-offset: 2px;
        border-radius: 4px;
    }

    /* Hide large background circles on mobile for better performance */
    .circle-1, .circle-2 {
        display: none;
    }

    .circle-3 {
        width: 160px;
        height: 160px;
        opacity: 0.4;
        background: radial-gradient(circle at center, rgba(31, 111, 235, 0.08), rgba(31, 111, 235, 0.02));
    }

    /* Mobile optimizations */
    .aurora,
    .light-streaks {
        opacity: 0.3;
    }

    .stars {
        opacity: 0.5;
    }

    /* Enhanced mobile notification */
    .notification {
        position: fixed;
        top: 1.5rem;
        left: 1rem;
        right: 1rem;
        max-width: none;
        border-radius: 10px;
        font-size: 0.9rem;
        z-index: 10000;
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
        animation: slideInDown 0.3s ease-out;
    }
}
    }
}
    
    .circle-3 {
        width: 200px;
        height: 200px;
        opacity: 0.3;
    }
    
    /* Enhanced mobile theme switch */
    .theme-switch {
        width: 48px;
        height: 48px;
        font-size: 1.1rem;
        top: 1rem;
        right: 1rem;
    }
    
    /* Better notification positioning */
    .notification {
        top: 1rem;
        left: 0.75rem;
        right: 0.75rem;
        width: auto;
        border-radius: 12px;
        font-size: 0.9rem;
    }
    
    /* Enhanced form footer for mobile */
    .form-footer {
        margin-top: 1.5rem;
        text-align: center;
    }
    
    .form-link {
        display: inline-block;
        margin: 0.25rem 0;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    body {
        padding: 0.5rem;
    }
    
    .form-container {
        padding: 1.5rem 1rem;
        border-radius: 12px;
    }
    
    .form-header h2 {
        font-size: 1.5rem;
        margin-bottom: 0.75rem;
    }
    
    .form-header .form-subtitle {
        font-size: 0.85rem;
    }

    .form-options {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
    
    .checkbox-container {
        font-size: 0.85rem;
    }
    
    .input-group input {
        padding: 0.75rem 0.875rem 0.75rem 2.5rem;
    }
    
    .input-group .input-icon {
        font-size: 1.1rem;
        left: 0.75rem;
    }
    
    .password-toggle {
        right: 0.75rem;
        width: 36px;
        height: 36px;
    }
    
    /* Very small screen optimizations */
    .theme-switch {
        width: 44px;
        height: 44px;
        top: 0.75rem;
        right: 0.75rem;
    }
    
    .verification-actions {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .verification-actions .btn {
        width: 100%;
        min-height: 48px;
        font-size: 1rem;
        padding: 14px 20px;
        margin-bottom: 8px;
    }
    
    /* Ensure registration button is fully visible on mobile */
    .btn-primary {
        width: 100%;
        min-height: 50px;
        font-size: 1rem;
        padding: 16px 24px;
        margin: 20px 0;
        box-sizing: border-box;
        position: relative;
        overflow: hidden;
        border-radius: 12px;
    }
    
    .form-container {
        padding-bottom: 40px;
        margin-bottom: 20px;
    }
    
    .form-footer {
        margin-top: 24px;
        padding-bottom: 20px;
    }

    .notification {
        width: calc(100vw - 2rem);
        max-width: calc(100vw - 2rem);
        min-width: auto;
        right: 1rem;
        left: 1rem;
        padding: 0.5rem 0.75rem;
        font-size: 0.875rem;
    }
}

/* Email Verification Form Styles */
.form-subtitle {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
    margin-top: 8px;
    text-align: center;
    line-height: 1.4;
}

.form-hint {
    margin-top: 8px;
}

.form-hint p {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.8rem;
    line-height: 1.3;
    margin: 0;
}

.verification-actions {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.verification-actions .btn {
    flex: 1;
}

.btn-outline {
    background: transparent;
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 14px 24px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.btn-outline:hover {
    border-color: rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 255, 255, 0.1);
}

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

#verificationCode {
    text-align: center;
    letter-spacing: 4px;
    font-size: 1.2rem;
    font-weight: 600;
    font-family: 'Courier New', monospace;
}

/* Enhanced form container transitions */
#verificationFormContainer {
    transform: translateX(100%);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

#verificationFormContainer.active {
    transform: translateX(0);
}

/* Animation for verification success */
@keyframes verificationSuccess {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.verification-success {
    animation: verificationSuccess 0.6s ease-out;
}

/* Mobile responsive for verification */
@media (max-width: 480px) {
    .verification-actions {
        flex-direction: column;
        gap: 10px;
    }
    
    #verificationCode {
        font-size: 1.1rem;
        letter-spacing: 2px;
    }
}

/* Terms of Use and Privacy Policy Modal Styles */
.terms-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.terms-modal.show {
    opacity: 1;
    visibility: visible;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    width: 100%;
    max-width: 600px;
    max-height: 80vh;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transform: scale(0.95) translateY(20px);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.terms-modal.show .modal-content {
    transform: scale(1) translateY(0);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 16px 16px 0 0;
    color: white;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
}

.modal-close {
    background: transparent;
    border: none;
    color: white;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.modal-body {
    padding: 1.5rem;
    flex: 1;
    color: #2d3748;
    line-height: 1.6;
}

.modal-body h3 {
    color: #4a5568;
    margin: 1.5rem 0 0.5rem 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.modal-body h3:first-child {
    margin-top: 0;
}

.modal-body p {
    margin: 0.5rem 0;
    color: #4a5568;
}

.modal-body p:last-child {
    margin-bottom: 0;
}

.terms-date {
    margin-top: 2rem !important;
    padding-top: 1rem;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    font-style: italic;
    color: #666 !important;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: flex-end;
    background: rgba(0, 0, 0, 0.02);
    border-radius: 0 0 16px 16px;
}

.modal-footer .btn {
    margin: 0;
    min-width: 120px;
}

/* Dark mode support for modals */
[data-theme="dark"] .modal-content {
    background: rgba(13, 17, 23, 0.95);
    border: 1px solid rgba(48, 54, 61, 0.8);
}

[data-theme="dark"] .modal-header {
    border-bottom: 1px solid rgba(48, 54, 61, 0.8);
}

[data-theme="dark"] .modal-body {
    color: #f0f6fc;
}

[data-theme="dark"] .modal-body h3 {
    color: #e6edf3;
}

[data-theme="dark"] .modal-body p {
    color: #8b949e;
}

[data-theme="dark"] .terms-date {
    border-top: 1px solid rgba(48, 54, 61, 0.8);
    color: #8b949e !important;
}

[data-theme="dark"] .modal-footer {
    border-top: 1px solid rgba(48, 54, 61, 0.8);
    background: rgba(0, 0, 0, 0.2);
}

/* Mobile responsiveness for modals */
@media (max-width: 640px) {
    .modal-content {
        margin: 1rem;
        max-height: calc(100vh - 2rem);
    }
    
    .modal-header {
        padding: 1rem;
    }
    
    .modal-header h2 {
        font-size: 1.25rem;
    }
    
    .modal-body {
        padding: 1rem;
    }
    
    .modal-footer {
        padding: 1rem;
    }
}
