/* AMNEEV Vision School - Login Page Styles */
/* Following AMNEEV Design System Guidelines */

:root {
    /* AMNEEV Brand Colors */
    --primary: #3b82f6;      /* Blue-500 - Main brand, CTAs, links */
    --secondary: #10b981;    /* Emerald-500 - Success, positive actions */
    --accent: #ef4444;       /* Red-500 - Errors, warnings, urgent actions */
    
    /* Neutral Colors */
    --background: #f8fafc;   /* Slate-50 - Main background */
    --surface: #ffffff;      /* White - Cards, modals, forms */
    --border: #e2e8f0;      /* Slate-200 - Borders, dividers */
    
    /* Text Colors */
    --text-primary: #0f172a;   /* Slate-900 - Main text */
    --text-secondary: #64748b; /* Slate-500 - Secondary text, labels */
    --text-muted: #94a3b8;    /* Slate-400 - Placeholder, disabled text */

    /* Layout */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    
    /* Typography */
    --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-size-xs: 0.75rem;
    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
}

/* Reset and Base Styles */
* {
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    background: var(--background);
    margin: 0;
    padding: 0;
    min-height: 100vh;
    color: var(--text-primary);
    line-height: 1.6;
}

/* Login Container */
.login-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.login-main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-md);
    padding-bottom: 80px; /* Space for fixed footer */
}

.login-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    overflow: hidden;
    width: 100%;
    max-width: 1000px;
    display: grid;
    grid-template-columns: 1fr;
    min-height: 600px;
}

/* Mobile-first: Single column */
@media (min-width: 768px) {
    .login-card {
        grid-template-columns: 1fr 1fr;
    }
}

/* Form Section */
.login-form-section {
    padding: var(--spacing-xl);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

@media (max-width: 767px) {
    .login-form-section {
        padding: var(--spacing-lg);
    }
}

/* Brand Section */
.brand-section {
    text-align: center;
    margin-bottom: var(--spacing-xl);
}

.brand-logo {
    max-width: 280px;
    height: auto;
    margin-bottom: var(--spacing-md);
}

@media (max-width: 767px) {
    .brand-logo {
        max-width: 200px;
    }
}

.brand-title {
    font-size: var(--font-size-xl);
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 var(--spacing-xs) 0;
}

.brand-subtitle {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary);
    margin: 0;
}

@media (max-width: 767px) {
    .brand-title {
        font-size: var(--font-size-lg);
    }
    .brand-subtitle {
        font-size: 1.5rem;
    }
}

/* Form Styles */
.login-form {
    space-y: var(--spacing-lg);
}

.form-group {
    margin-bottom: var(--spacing-lg);
}

.form-label {
    display: block;
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-sm);
}

.form-label-wrapper {
    display: flex;
    justify-content: between;
    align-items: center;
    margin-bottom: var(--spacing-sm);
}

.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
    color: var(--text-primary);
    font-size: var(--font-size-base);
    transition: all 0.2s ease;
    min-height: 48px; /* Touch-friendly */
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-input::placeholder {
    color: var(--text-muted);
}

/* Input with Icon */
.input-with-icon {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

.input-with-icon .form-input {
    padding-left: 2.5rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    font-weight: 500;
    font-size: var(--font-size-base);
    text-decoration: none;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
    min-height: 48px;
    gap: var(--spacing-sm);
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.btn-secondary {
    background: var(--surface);
    color: var(--text-primary);
    border: 2px solid var(--border);
}

.btn-secondary:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.btn-full {
    width: 100%;
}

/* Links */
.link {
    color: var(--primary);
    text-decoration: none;
    font-size: var(--font-size-sm);
    font-weight: 500;
    transition: color 0.2s ease;
}

.link:hover {
    color: #2563eb;
    text-decoration: underline;
}

/* Checkbox */
.checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin: var(--spacing-lg) 0;
}

.checkbox {
    width: 1rem;
    height: 1rem;
    border: 2px solid var(--border);
    border-radius: 4px;
    background: var(--surface);
    cursor: pointer;
}

.checkbox:checked {
    background: var(--primary);
    border-color: var(--primary);
}

.checkbox-label {
    font-size: var(--font-size-sm);
    color: var(--text-primary);
    cursor: pointer;
}

/* Image Section */
.login-image-section {
    background: linear-gradient(135deg, var(--primary) 0%, #2563eb 100%);
    position: relative;
    display: none;
}

@media (min-width: 768px) {
    .login-image-section {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        padding: var(--spacing-xl);
        color: white;
        text-align: center;
    }
}

.login-bg-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.2;
}

.image-content {
    position: relative;
    z-index: 1;
}

.image-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: var(--spacing-md);
}

.image-subtitle {
    font-size: var(--font-size-lg);
    margin-bottom: var(--spacing-xl);
    opacity: 0.9;
}

.feature-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
    font-size: var(--font-size-base);
}

.feature-icon {
    width: 1.5rem;
    height: 1.5rem;
    flex-shrink: 0;
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: var(--spacing-md);
}

.modal.show {
    display: flex;
}

.modal-content {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    width: 100%;
    max-width: 400px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    padding: var(--spacing-lg);
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-body {
    padding: var(--spacing-lg);
}

/* Footer */
.login-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--border);
    padding: var(--spacing-md);
    z-index: 100;
}

.footer-content {
    text-align: center;
    font-size: var(--font-size-xs);
    color: var(--text-secondary);
}

.footer-copyright {
    margin-bottom: var(--spacing-sm);
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: var(--spacing-md);
    flex-wrap: wrap;
}

.footer-links .link {
    font-size: var(--font-size-xs);
}

.footer-divider {
    color: var(--text-muted);
    margin: 0 var(--spacing-xs);
}

@media (max-width: 480px) {
    .footer-links {
        flex-direction: column;
        gap: var(--spacing-sm);
    }
    .footer-divider {
        display: none;
    }
}

/* Alerts */
.alert {
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-lg);
    border-left: 4px solid;
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-sm);
}

.alert-success {
    background: #ecfdf5;
    border-left-color: var(--secondary);
    color: #065f46;
}

.alert-error {
    background: #fef2f2;
    border-left-color: var(--accent);
    color: #991b1b;
}

.alert-info {
    background: #eff6ff;
    border-left-color: var(--primary);
    color: #1e40af;
}

/* OTP Input Styling */
.otp-input {
    text-align: center;
    font-size: 1.5rem;
    letter-spacing: 0.5rem;
    font-weight: 600;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.3s ease-out;
}

/* Password Toggle */
.password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0;
    width: 1.5rem;
    height: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.password-toggle:hover {
    color: var(--text-primary);
}

/* Loading States */
.btn.loading {
    position: relative;
    color: transparent;
}

.btn.loading::after {
    content: '';
    position: absolute;
    width: 1rem;
    height: 1rem;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    color: white;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Utility Classes */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.text-center {
    text-align: center;
}

.hidden {
    display: none;
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    :root {
        --background: #0f172a;
        --surface: #1e293b;
        --border: #334155;
        --text-primary: #f1f5f9;
        --text-secondary: #cbd5e1;
        --text-muted: #64748b;
    }
    
    .login-footer {
        background: rgba(30, 41, 59, 0.95);
    }
}