/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Student Theme - Modern Vibrant */
    --student-primary: #6366f1;
    --student-secondary: #8b5cf6;
    --student-accent: #06b6d4;
    --student-bg: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    /* Teacher Theme - Professional Modern */
    --teacher-primary: #0f172a;
    --teacher-secondary: #1e293b;
    --teacher-accent: #0ea5e9;
    --teacher-bg: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    /* Parent Theme - Warm Modern */
    --parent-primary: #059669;
    --parent-secondary: #0d9488;
    --parent-accent: #06b6d4;
    --parent-bg: linear-gradient(135deg, #059669 0%, #0d9488 100%);
    /* Default/Neutral Colors - Modern Dark */
    --neutral-bg: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    --white: #ffffff;
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    /* Transitions */
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--gray-900);
    background: #0a0a0a;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 20% 80%, rgba(120, 119, 198, 0.3) 0%, transparent 50%), radial-gradient(circle at 80% 20%, rgba(255, 119, 198, 0.3) 0%, transparent 50%), radial-gradient(circle at 40% 40%, rgba(120, 219, 255, 0.2) 0%, transparent 50%);
    z-index: -1;
    animation: float 20s ease-in-out infinite;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0px) rotate(0deg);
    }

    33% {
        transform: translateY(-20px) rotate(1deg);
    }

    66% {
        transform: translateY(10px) rotate(-1deg);
    }
}

/* Main Container */
.container {
    display: flex;
    min-height: 100vh;
    position: relative;
}

/* Left Panel - Branding */
.left-panel {
    flex: 0 0 40%;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    position: relative;
    overflow: hidden;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.left-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 30% 70%, rgba(99, 102, 241, 0.1) 0%, transparent 50%), radial-gradient(circle at 70% 30%, rgba(139, 92, 246, 0.1) 0%, transparent 50%);
    z-index: 1;
}

.brand-content {
    text-align: center;
    color: var(--white);
    z-index: 2;
    position: relative;
    max-width: 400px;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.logo i {
    font-size: 3rem;
    color: var(--white);
}

.logo h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--white);
}

.tagline {
    font-size: 1.1rem;
    font-weight: 300;
    margin-bottom: 3rem;
    opacity: 0.9;
    line-height: 1.5;
}

/* Education Graphic Animation */
.illustration {
    margin-bottom: 3rem;
}

.education-graphic {
    position: relative;
    width: 200px;
    height: 200px;
    margin: 0 auto;
}

.planet {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.planet i {
    font-size: 1.5rem;
    color: var(--white);
}

.orbit {
    position: absolute;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.orbit-1 {
    width: 120px;
    height: 120px;
    animation: rotate 20s linear infinite;
}

.orbit-2 {
    width: 160px;
    height: 160px;
    animation: rotate 30s linear infinite reverse;
}

.orbit-3 {
    width: 200px;
    height: 200px;
    animation: rotate 40s linear infinite;
}

.satellite {
    position: absolute;
    width: 30px;
    height: 30px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
}

.satellite i {
    font-size: 0.8rem;
    color: var(--white);
}

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

    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* Features */
.features {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.feature {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9rem;
    opacity: 0.8;
}

.feature i {
    font-size: 1rem;
    width: 20px;
}

/* Right Panel - Login */
.right-panel {
    flex: 0 0 60%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    position: relative;
}

.right-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
    z-index: -1;
}

.login-content {
    width: 100%;
    max-width: 480px;
}

.login-content h2 {
    font-size: 2rem;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 0.5rem;
}

.subtitle {
    color: var(--gray-600);
    margin-bottom: 2rem;
    font-size: 1rem;
}

/* Role Selection Cards */
.role-selection {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

.role-card {
    padding: 1.5rem 1rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.role-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0.05) 100%);
    opacity: 0;
    transition: var(--transition);
}

.role-card:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    border-color: rgba(255, 255, 255, 0.4);
}

.role-card:hover::before {
    opacity: 1;
}

.role-card.active {
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.2);
}

.role-card.active.student {
    border-color: var(--student-primary);
    background: linear-gradient(135deg, var(--student-primary) 0%, var(--student-secondary) 100%);
    color: var(--white);
    box-shadow: 0 25px 50px rgba(99, 102, 241, 0.4);
}

.role-card.active.teacher {
    border-color: var(--teacher-primary);
    background: linear-gradient(135deg, var(--teacher-primary) 0%, var(--teacher-secondary) 100%);
    color: var(--white);
    box-shadow: 0 25px 50px rgba(15, 23, 42, 0.4);
}

.role-card.active.parent {
    border-color: var(--parent-primary);
    background: linear-gradient(135deg, var(--parent-primary) 0%, var(--parent-secondary) 100%);
    color: var(--white);
    box-shadow: 0 25px 50px rgba(5, 150, 105, 0.4);
}

.role-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: var(--gray-600);
    transition: var(--transition);
}

.role-card.active .role-icon {
    color: var(--white);
}

.role-info h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: inherit;
}

.role-info p {
    font-size: 0.8rem;
    opacity: 0.8;
    margin-bottom: 0.5rem;
}

.role-preview {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    opacity: 0.7;
}

/* Login Form */
.login-form {
    margin-bottom: 2rem;
}

.form-group {
    position: relative;
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--gray-700);
    margin-bottom: 0.5rem;
}

.form-group input {
    width: 100%;
    padding: 0.875rem 1.25rem;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    font-size: 1rem;
    transition: var(--transition);
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
}

.form-group input:focus {
    outline: none;
    border-color: var(--student-primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15), 0 8px 24px rgba(0, 0, 0, 0.1);
    background: var(--white);
    transform: translateY(-1px);
}

.password-toggle {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: var(--gray-400);
    transition: var(--transition);
    margin-top: 0.75rem;
}

.password-toggle:hover {
    color: var(--gray-600);
}

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    font-size: 0.9rem;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    color: var(--gray-600);
}

.remember-me input {
    width: auto;
    margin: 0;
}

.forgot-password {
    color: var(--student-primary);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}

.forgot-password:hover {
    text-decoration: underline;
}

/* Login Button */
.login-btn {
    width: 100%;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, var(--student-primary) 0%, var(--student-secondary) 100%);
    color: var(--white);
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: 0 8px 32px rgba(99, 102, 241, 0.3);
    position: relative;
    overflow: hidden;
}

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

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

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(99, 102, 241, 0.4);
}

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

/* Dynamic Button Colors */
body.teacher-theme .login-btn {
    background: linear-gradient(135deg, var(--teacher-primary) 0%, var(--teacher-secondary) 100%);
    box-shadow: 0 8px 32px rgba(15, 23, 42, 0.3);
}

body.teacher-theme .login-btn:hover {
    box-shadow: 0 12px 40px rgba(15, 23, 42, 0.4);
}

body.parent-theme .login-btn {
    background: linear-gradient(135deg, var(--parent-primary) 0%, var(--parent-secondary) 100%);
    box-shadow: 0 8px 32px rgba(5, 150, 105, 0.3);
}

body.parent-theme .login-btn:hover {
    box-shadow: 0 12px 40px rgba(5, 150, 105, 0.4);
}

body.teacher-theme .form-group input:focus {
    border-color: var(--teacher-primary);
    box-shadow: 0 0 0 4px rgba(15, 23, 42, 0.15), 0 8px 24px rgba(0, 0, 0, 0.1);
}

body.parent-theme .form-group input:focus {
    border-color: var(--parent-primary);
    box-shadow: 0 0 0 4px rgba(5, 150, 105, 0.15), 0 8px 24px rgba(0, 0, 0, 0.1);
}

body.teacher-theme .forgot-password {
    color: var(--teacher-primary);
}

body.parent-theme .forgot-password {
    color: var(--parent-primary);
}

/* Dynamic Background Colors */
body.teacher-theme .left-panel {
    background: var(--teacher-bg);
}

body.parent-theme .left-panel {
    background: var(--parent-bg);
}

.signup-link {
    text-align: center;
    margin-top: 1.5rem;
    color: var(--gray-600);
    font-size: 0.9rem;
}

.signup-link a {
    color: var(--student-primary);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}

.signup-link a:hover {
    text-decoration: underline;
}

body.teacher-theme .signup-link a {
    color: var(--teacher-primary);
}

body.parent-theme .signup-link a {
    color: var(--parent-primary);
}

/* Google Login Button */
.divider {
    display: flex;
    align-items: center;
    margin: 1.5rem 0;
    text-align: center;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--gray-300);
}

.divider span {
    padding: 0 1rem;
    color: var(--gray-500);
    font-size: 0.9rem;
    font-weight: 500;
}

.google-btn {
    width: 100%;
    padding: 0.875rem 1.5rem;
    background: var(--white);
    color: var(--gray-700);
    border: 2px solid var(--gray-300);
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.google-btn:hover {
    background: var(--gray-50);
    border-color: var(--gray-400);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

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

.google-btn svg {
    flex-shrink: 0;
}

/* Demo Mode */
.demo-mode {
    margin-bottom: 2rem;
    text-align: center;
}

.demo-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(0, 0, 0, 0.1);
    color: var(--gray-700);
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
}

.demo-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(0, 0, 0, 0.2);
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

/* Language Selector */
.language-selector {
    text-align: center;
}

.language-selector select {
    padding: 0.5rem 1rem;
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    background: var(--white);
    color: var(--gray-700);
    font-size: 0.9rem;
    cursor: pointer;
}

/* Footer */
.footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    padding: 1rem 2rem;
    z-index: 100;
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.05);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    font-size: 0.85rem;
    color: var(--gray-600);
}

.footer-links {
    display: flex;
    gap: 1.5rem;
}

.footer-links a {
    color: var(--gray-600);
    text-decoration: none;
    transition: var(--transition);
}

.footer-links a:hover {
    color: var(--gray-900);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .container {
        flex-direction: column;
    }

    .left-panel {
        flex: none;
        min-height: 40vh;
        padding: 1.5rem;
    }

    .right-panel {
        flex: none;
        padding: 1.5rem;
    }

    .brand-content {
        max-width: none;
    }

    .logo h1 {
        font-size: 2rem;
    }

    .tagline {
        font-size: 1rem;
        margin-bottom: 2rem;
    }

    .illustration {
        margin-bottom: 2rem;
    }

    .education-graphic {
        width: 150px;
        height: 150px;
    }

    .features {
        flex-direction: row;
        justify-content: center;
        gap: 2rem;
    }
}

@media (max-width: 768px) {
    .role-selection {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .role-card {
        padding: 1rem;
        display: flex;
        align-items: center;
        text-align: left;
        gap: 1rem;
    }

    .role-icon {
        font-size: 1.5rem;
        margin-bottom: 0;
    }

    .role-info {
        flex: 1;
    }

    .role-preview {
        justify-content: flex-start;
        margin-top: 0.25rem;
    }

    .left-panel {
        min-height: 30vh;
        padding: 1rem;
    }

    .features {
        flex-direction: column;
        gap: 1rem;
    }

    .footer-content {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }

    .footer-links {
        gap: 1rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding-bottom: 80px;
    }

    .right-panel {
        padding: 1rem;
    }

    .login-content h2 {
        font-size: 1.5rem;
    }

    .role-card {
        padding: 0.75rem;
    }

    .form-options {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: var(--white);
    animation: spin 1s ease-in-out infinite;
}

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

/* Success/Error States */
.form-group.error input {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.form-group.success input {
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.error-message {
    color: #ef4444;
    font-size: 0.8rem;
    margin-top: 0.25rem;
    display: none;
}

.form-group.error .error-message {
    display: block;
}

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

/* Focus styles for keyboard navigation */
.role-card:focus,
.login-btn:focus,
.demo-btn:focus {
    outline: 2px solid var(--student-primary);
    outline-offset: 2px;
}

body.teacher-theme .role-card:focus,
body.teacher-theme .login-btn:focus {
    outline-color: var(--teacher-primary);
}

body.parent-theme .role-card:focus,
body.parent-theme .login-btn:focus {
    outline-color: var(--parent-primary);
}