/* ===========================
   INFINITE QUESTION BANK - AUTH PAGES
   Modern Vibrant Design System
   =========================== */

/* === CUSTOM PROPERTIES === */
:root {
    /* Primary Colors */
    --color-primary: #6366f1;
    --color-primary-dark: #4f46e5;
    --color-primary-light: #818cf8;
    
    /* Math Theme */
    --color-math: #ec4899;
    --color-math-light: #f9a8d4;
    --color-math-gradient: linear-gradient(135deg, #ec4899 0%, #f43f5e 100%);
    
    /* Science Theme */
    --color-science: #14b8a6;
    --color-science-light: #5eead4;
    --color-science-gradient: linear-gradient(135deg, #14b8a6 0%, #06b6d4 100%);
    
    /* Accent Colors */
    --color-accent-red: #ef4444;
    --color-accent-yellow: #f59e0b;
    --color-accent-blue: #3b82f6;
    
    /* Neutrals */
    --color-dark: #0f172a;
    --color-dark-2: #1e293b;
    --color-dark-3: #334155;
    --color-light: #f8fafc;
    --color-white: #ffffff;
    --color-text: #64748b;
    
    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-hero: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    --gradient-dark: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
    
    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.15);
    --shadow-xl: 0 16px 64px rgba(0, 0, 0, 0.2);
    --shadow-glow: 0 0 40px rgba(102, 126, 234, 0.4);
    
    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
    --spacing-2xl: 4rem;
    --spacing-3xl: 6rem;
    
    /* Border Radius */
    --radius-sm: 0.5rem;
    --radius-md: 1rem;
    --radius-lg: 1.5rem;
    --radius-xl: 2rem;
    --radius-full: 9999px;
    
    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-base: 0.3s ease;
    --transition-slow: 0.5s ease;
}

/* === RESET & BASE === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    color: var(--color-dark);
    background: var(--color-light);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* === GEOMETRIC BACKGROUND PATTERN === */
.auth-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: linear-gradient(180deg, #f8fafc 0%, #e0e7ff 100%);
    overflow: hidden;
}

.circle {
    position: absolute;
    border-radius: 50%;
    opacity: 0.1;
    animation: float 20s infinite ease-in-out;
}

.circle-1 {
    width: 600px;
    height: 600px;
    background: var(--gradient-primary);
    top: -200px;
    right: -100px;
    animation-delay: 0s;
}

.circle-2 {
    width: 800px;
    height: 800px;
    background: var(--color-math-gradient);
    bottom: -300px;
    left: -200px;
    animation-delay: 5s;
}

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

/* === AUTH CONTAINER === */
.auth-container {
    width: 100%;
    max-width: 480px;
    padding: var(--spacing-lg);
    z-index: 10;
    position: relative;
}

/* === AUTH CARD === */
.auth-card {
    background: var(--color-white);
    border-radius: var(--radius-xl);
    padding: var(--spacing-2xl);
    box-shadow: var(--shadow-xl);
    position: relative;
    overflow: visible;
}

.fade-in {
    animation: fadeInUp 0.6s ease-out;
}

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

/* === AUTH HEADER === */
.auth-header {
    text-align: center;
    margin-bottom: var(--spacing-xl);
}

.logo {
    display: inline-block;
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--color-dark);
    text-decoration: none;
    letter-spacing: -0.5px;
    transition: var(--transition-base);
    margin-bottom: var(--spacing-md);
}

.logo span {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo:hover {
    transform: translateY(-2px);
}

.auth-header h2 {
    font-size: 2rem;
    font-weight: 800;
    color: var(--color-dark);
    margin-bottom: var(--spacing-xs);
    letter-spacing: -0.5px;
}

.auth-header p {
    font-size: 1rem;
    color: var(--color-text);
    font-weight: 500;
}

/* === FORM STYLES === */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.form-group label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--color-dark-3);
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.form-group label i {
    color: var(--color-primary);
    font-size: 0.875rem;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"] {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    font-family: inherit;
    color: var(--color-dark);
    background: var(--color-white);
    transition: all var(--transition-base);
    outline: none;
}

.form-group input::placeholder {
    color: #94a3b8;
}

.form-group input:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
    transform: translateY(-2px);
}

.form-group input:hover:not(:focus) {
    border-color: #cbd5e1;
}

/* === CLASS SELECTOR (Radio Cards) === */
.class-selector {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-md);
}

.radio-card {
    position: relative;
    cursor: pointer;
}

.radio-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.card-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-lg);
    border: 2px solid #e2e8f0;
    border-radius: var(--radius-md);
    background: var(--color-white);
    transition: all var(--transition-base);
    text-align: center;
    min-height: 100px;
    position: relative;
}

.card-content .grade {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--color-dark);
    margin-bottom: 0.25rem;
    transition: var(--transition-base);
}

.card-content .desc {
    font-size: 0.85rem;
    color: var(--color-text);
    font-weight: 500;
}

.radio-card:hover .card-content {
    border-color: var(--color-primary-light);
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.radio-card input[type="radio"]:checked + .card-content {
    border-color: var(--color-primary);
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
    transform: translateY(-4px);
}

.radio-card input[type="radio"]:checked + .card-content .grade {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* === FORM ACTIONS === */
.form-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: calc(-1 * var(--spacing-sm));
}

.forgot-pass {
    color: var(--color-primary);
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition-base);
}

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

/* === BUTTONS === */
.btn-auth {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    padding: 0.875rem 1.75rem;
    border-radius: var(--radius-full);
    font-weight: 600;
    text-decoration: none;
    transition: all var(--transition-base);
    border: none;
    cursor: pointer;
    font-size: 0.95rem;
    white-space: nowrap;
    width: 100%;
    font-family: inherit;
    color: var(--color-white);
    position: relative;
    overflow: hidden;
}

.btn-auth::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.btn-auth:active::before {
    width: 300px;
    height: 300px;
    transition: width 0s, height 0s;
}

.btn-blue {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    box-shadow: var(--shadow-md);
}

.btn-blue:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-xl), 0 0 40px rgba(59, 130, 246, 0.4);
}

.btn-red {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    box-shadow: var(--shadow-md);
}

.btn-red:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-xl), 0 0 40px rgba(239, 68, 68, 0.4);
}

.btn-auth i {
    transition: var(--transition-base);
}

.btn-auth:hover i {
    transform: translateX(4px);
}

/* === AUTH FOOTER === */
.auth-footer {
    text-align: center;
    margin-top: var(--spacing-xl);
    padding-top: var(--spacing-lg);
    border-top: 1px solid #e2e8f0;
}

.auth-footer p {
    color: var(--color-text);
    font-size: 0.9rem;
}

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

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

/* === ERROR MESSAGE === */
.error-message {
    display: none;
    margin-top: var(--spacing-md);
    padding: var(--spacing-md);
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    border: 2px solid #f87171;
    border-radius: var(--radius-md);
    color: #dc2626;
    font-size: 0.875rem;
    font-weight: 600;
    text-align: center;
    animation: shake 0.5s ease;
}

.error-message.show {
    display: block;
}

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

/* === SUCCESS MESSAGE === */
.success-message {
    display: none;
    margin-top: var(--spacing-md);
    padding: var(--spacing-md);
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    border: 2px solid #6ee7b7;
    border-radius: var(--radius-md);
    color: #059669;
    font-size: 0.875rem;
    font-weight: 600;
    text-align: center;
    animation: slideDown 0.5s ease;
}

.success-message.show {
    display: block;
}

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

/* === LOADING STATE === */
.btn-auth.loading {
    pointer-events: none;
    opacity: 0.7;
}

.btn-auth.loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    border: 2px solid var(--color-white);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    right: var(--spacing-lg);
}

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

/* === RESPONSIVE DESIGN === */
@media (max-width: 768px) {
    .auth-container {
        padding: var(--spacing-md);
        max-width: 100%;
    }
    
    .auth-card {
        padding: var(--spacing-xl);
    }
    
    .auth-header h2 {
        font-size: 1.75rem;
    }
    
    .circle-1 {
        width: 400px;
        height: 400px;
    }
    
    .circle-2 {
        width: 500px;
        height: 500px;
    }
}

@media (max-width: 480px) {
    .auth-container {
        padding: var(--spacing-sm);
    }
    
    .auth-card {
        padding: var(--spacing-lg);
        border-radius: var(--radius-lg);
    }
    
    .auth-header h2 {
        font-size: 1.5rem;
    }
    
    .auth-header p {
        font-size: 0.9rem;
    }
    
    .logo {
        font-size: 1.5rem;
    }
    
    .class-selector {
        grid-template-columns: 1fr;
    }
    
    .card-content {
        min-height: 80px;
    }
    
    .btn-auth {
        padding: 0.875rem 1.5rem;
    }
    
    .circle-1,
    .circle-2 {
        width: 300px;
        height: 300px;
    }
}

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

input:focus-visible,
button:focus-visible,
a:focus-visible {
    outline: 3px solid var(--color-primary);
    outline-offset: 2px;
}

@media (prefers-contrast: high) {
    .auth-card {
        border: 2px solid var(--color-dark);
    }
    
    .form-group input {
        border-width: 3px;
    }
}