/* ============================================================
   BLOOM ACADEMY - UNIFIED THEME SYSTEM (LOGIN PAGE REDESIGN)
   ============================================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family, 'Inter', -apple-system, BlinkMacSystemFont, sans-serif);
    background-color: var(--vscode-bg, #f8fafc);
    color: var(--vscode-text-primary, #0f172a);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
    position: relative;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Background decorative blur elements */
.auth-bg-decor-1 {
    position: absolute;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.12) 0%, rgba(255, 255, 255, 0) 70%);
    top: -15%;
    left: -10%;
    z-index: 0;
    filter: blur(80px);
    pointer-events: none;
}

.auth-bg-decor-2 {
    position: absolute;
    width: 700px;
    height: 700px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.12) 0%, rgba(255, 255, 255, 0) 70%);
    bottom: -20%;
    right: -10%;
    z-index: 0;
    filter: blur(80px);
    pointer-events: none;
}

/* Dark mode adjustments for background decoration */
html.dark-theme .auth-bg-decor-1 {
    background: radial-gradient(circle, rgba(0, 122, 204, 0.08) 0%, rgba(0, 0, 0, 0) 70%);
}

html.dark-theme .auth-bg-decor-2 {
    background: radial-gradient(circle, rgba(139, 92, 246, 0.06) 0%, rgba(0, 0, 0, 0) 70%);
}

.login-page {
    width: 100%;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
    position: relative;
}

/* Two-column layout grid */
.login-wrapper {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    width: 100%;
    min-height: 100vh;
    background-color: var(--vscode-bg, #f8fafc);
    transition: background-color 0.3s ease;
}

/* LEFT PANEL: Branding & Illustration */
.illustration-panel {
    position: relative;
    background: linear-gradient(135deg, #4f46e5 0%, #2563eb 50%, #06b6d4 100%);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 3rem;
    overflow: hidden;
}

/* High-tech overlay grid */
.illustration-overlay-grid {
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255, 255, 255, 0.15) 1px, transparent 1px);
    background-size: 24px 24px;
    pointer-events: none;
    z-index: 1;
}

.illustration-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
    color: #ffffff;
}

.branding-header {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-logo {
    width: 44px;
    height: 44px;
    object-fit: contain;
    border-radius: 10px;
    background-color: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(8px);
    padding: 4px;
}

.brand-logo-fallback {
    font-size: 1.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background-color: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(8px);
}

.brand-name {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.illustration-graphic-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 2rem 0;
    perspective: 1000px;
}

.promo-illustration {
    width: 100%;
    max-width: 460px;
    height: auto;
}

.branding-footer {
    max-width: 520px;
}

.branding-title {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 1rem;
    line-height: 1.2;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.branding-description {
    font-size: 0.95rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.85);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* RIGHT PANEL: Login Form */
.form-panel {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2.5rem;
    background-color: var(--vscode-bg, #f8fafc);
    position: relative;
    z-index: 2;
}

/* Premium Login Card */
.auth-card {
    background-color: var(--vscode-card, #ffffff);
    border: 1px solid var(--vscode-border, #e2e8f0);
    border-radius: 24px;
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.04);
    width: 100%;
    max-width: 520px; /* Increased 15-20% */
    overflow: hidden;
    animation: fadeInCard 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease, background-color 0.3s ease;
}

/* Light mode Glassmorphism effect */
@supports (backdrop-filter: blur(16px)) {
    .auth-card {
        background-color: rgba(255, 255, 255, 0.8);
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
        border: 1px solid rgba(255, 255, 255, 0.5);
    }
}

.auth-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 24px 48px rgba(15, 23, 42, 0.08);
}

.auth-card-header {
    padding: 2.5rem 2rem 1.5rem;
    text-align: center;
    position: relative;
    border-bottom: 1px solid var(--vscode-border-soft, #f1f5f9);
}

.auth-back-link {
    position: absolute;
    top: 1.5rem;
    left: 1.5rem;
    text-decoration: none;
    color: var(--vscode-text-secondary, #475569);
    font-size: var(--font-size-xs, 0.75rem);
    font-weight: var(--font-weight-semibold, 600);
    transition: color 0.2s ease, transform 0.2s ease;
}

.auth-back-link:hover {
    color: var(--color-primary, #2563eb);
    transform: translateX(-2px);
}

.header-logo-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 1.25rem;
}

.auth-school-logo {
    width: 64px;
    height: 64px;
    object-fit: contain;
    margin-bottom: 0.75rem;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.auth-school-logo-fallback {
    font-size: 2.2rem;
    margin-bottom: 0.75rem;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 64px;
    height: 64px;
    background-color: var(--vscode-border-soft, #f1f5f9);
    border-radius: 12px;
}

.auth-school-name {
    font-size: 1.35rem;
    color: var(--vscode-text-primary, #0f172a);
    font-weight: var(--font-weight-bold, 700);
    margin-bottom: 0.375rem;
    line-height: 1.2;
}

.auth-academic-badge {
    display: inline-block;
    font-size: 11px;
    background-color: rgba(37, 99, 235, 0.08);
    color: var(--color-primary, #2563eb);
    padding: 4px 12px;
    border-radius: 9999px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.auth-welcome-title {
    font-size: 1.5rem;
    color: var(--vscode-text-primary, #0f172a);
    font-weight: 700;
    margin-bottom: 0.375rem;
}

.auth-welcome-subtitle {
    font-size: 0.9rem;
    color: var(--vscode-text-secondary, #475569);
}

.auth-card-body {
    padding: 2rem 2.5rem 2.5rem;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem; /* Better spacing between form groups */
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-label {
    font-size: 15px; /* Larger label font size */
    font-weight: 600; /* Bold/Medium font weight */
    color: var(--vscode-text-primary, #0f172a);
    letter-spacing: 0.2px;
}

.input-group {
    position: relative;
    width: 100%;
}

.form-input {
    width: 100%;
    height: 52px; /* Increased input height */
    padding: 12px 52px 12px 18px !important; /* 18px left padding, 52px right for status icon */
    border: 1.5px solid var(--vscode-border, #e2e8f0);
    background-color: var(--vscode-surface, #ffffff);
    color: var(--vscode-text-primary, #0f172a);
    border-radius: 12px; /* Rounded corners */
    font-size: 15px; /* Increased font size */
    outline: none;
    transition: border-color 0.25s cubic-bezier(0.4, 0, 0.2, 1), 
                box-shadow 0.25s cubic-bezier(0.4, 0, 0.2, 1), 
                background-color 0.25s ease;
}

.form-input:hover {
    border-color: #cbd5e1;
}

.form-input:focus {
    border-color: var(--color-primary, #2563eb);
    box-shadow: 0 0 0 4px var(--vscode-hover, rgba(37, 99, 235, 0.08));
}

.form-input[type="password"] {
    padding-right: 80px !important; /* Space for eye toggle (right: 18px) and status icon (right: 48px) */
}

input[type="date"].form-input {
    padding-right: 80px !important; /* Space for calendar emoji (right: 18px) and status icon (right: 48px) */
}

.form-input::placeholder {
    color: var(--vscode-text-muted, #94a3b8);
    font-size: 14px;
}

/* Validation styling */
.form-input.is-valid {
    border-color: var(--vscode-success, #16a34a) !important;
    box-shadow: 0 0 0 4px rgba(22, 163, 74, 0.12) !important;
}

.form-input.is-invalid {
    border-color: var(--vscode-danger, #dc2626) !important;
    box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.12) !important;
}

.validation-status-icon {
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    display: none;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 5;
}

.form-input.is-valid ~ .validation-status-icon {
    display: flex;
    color: var(--vscode-success, #16a34a);
}

.form-input.is-valid ~ .validation-status-icon::before {
    content: "✓";
    font-weight: bold;
    font-size: 1.1rem;
}

.form-input.is-invalid ~ .validation-status-icon {
    display: flex;
    color: var(--vscode-danger, #dc2626);
}

.form-input.is-invalid ~ .validation-status-icon::before {
    content: "✗";
    font-weight: bold;
    font-size: 1.1rem;
}

/* Error text feedback */
.validation-feedback {
    color: var(--vscode-danger, #dc2626);
    font-size: 0.8rem;
    margin-top: 4px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
}

.validation-feedback::before {
    content: "•";
    font-weight: bold;
}

/* Dropdown select improvements */
select.form-input {
    appearance: none;
    -webkit-appearance: none;
    -moz-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='%2394a3b8' 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 18px center;
    background-size: 16px;
    padding-right: 48px !important;
}

select.form-input:focus {
    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='%232563eb' 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");
}

/* Date picker inputs */
input[type="date"].form-input {
    position: relative;
    padding-right: 48px;
}

input[type="date"].form-input::-webkit-calendar-picker-indicator {
    background: transparent;
    bottom: 0;
    color: transparent;
    cursor: pointer;
    height: auto;
    left: 0;
    position: absolute;
    right: 0;
    top: 0;
    width: auto;
    z-index: 2;
}

.date-input-wrapper {
    position: relative;
    width: 100%;
}

.date-input-wrapper::after {
    content: "📅";
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.1rem;
    pointer-events: none;
    color: var(--vscode-text-muted, #94a3b8);
}

/* Password Eye toggle */
.password-toggle-btn {
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--vscode-text-muted, #94a3b8);
    cursor: pointer;
    font-size: 1.15rem;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
    border-radius: 8px;
    z-index: 6;
    transition: color 0.2s ease, background-color 0.2s ease;
}

.password-toggle-btn:hover {
    color: var(--vscode-text-primary, #0f172a);
    background-color: var(--vscode-border-soft, #f1f5f9);
}

/* Remember Me & Forgot Password link layout */
.form-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    margin-top: 0.25rem;
}

.remember-me-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: var(--vscode-text-secondary, #475569);
    user-select: none;
    font-weight: 500;
}

.remember-checkbox {
    width: 17px;
    height: 17px;
    accent-color: var(--color-primary, #2563eb);
    cursor: pointer;
    border-radius: 4px;
}

.forgot-password-link {
    color: var(--color-primary, #2563eb);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
}

.forgot-password-link:hover {
    color: var(--color-primary-dark, #1d4ed8);
    text-decoration: underline;
}

/* Submission Button styling */
.btn-login {
    width: 100%;
    height: 52px; /* Button height */
    background: linear-gradient(135deg, var(--color-primary, #2563eb) 0%, var(--color-primary-dark, #1d4ed8) 100%);
    color: #ffffff;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 0.75rem;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), 
                box-shadow 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), 
                background-color 0.25s ease;
}

.btn-login:hover {
    transform: translateY(-1.5px) scale(1.02); /* Slight scale effect on hover */
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.35);
}

.btn-login:active {
    transform: translateY(1px) scale(0.98);
}

.btn-login:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.auth-card-footer {
    margin-top: 2rem;
    text-align: center;
    font-size: 14px;
    color: var(--vscode-text-secondary, #475569);
    font-weight: 500;
}

.auth-card-footer a {
    color: var(--color-primary, #2563eb);
    text-decoration: none;
    font-weight: 600;
    margin-left: 4px;
    transition: color 0.2s ease;
}

.auth-card-footer a:hover {
    color: var(--color-primary-dark, #1d4ed8);
    text-decoration: underline;
}

/* Spinner helper for loading state */
.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #ffffff;
    animation: spin 0.8s linear infinite;
}

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

/* ============================================================
   DARK THEME COMPATIBILITY OVERRIDES (VS CODE EDITION)
   ============================================================ */
html.dark-theme body {
    background-color: var(--vscode-bg, #1e1e1e);
}

html.dark-theme .login-wrapper {
    background-color: var(--vscode-bg, #1e1e1e);
}

html.dark-theme .form-panel {
    background-color: var(--vscode-bg, #1e1e1e);
}

html.dark-theme .auth-card {
    background-color: var(--vscode-card, #252526);
    border: 1px solid var(--vscode-border, #2d2d2d);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

@supports (backdrop-filter: blur(16px)) {
    html.dark-theme .auth-card {
        background-color: rgba(37, 37, 38, 0.7);
        border: 1px solid rgba(255, 255, 255, 0.05);
    }
}

html.dark-theme .auth-card-header {
    border-bottom: 1px solid var(--vscode-border, #2d2d2d);
}

html.dark-theme .form-input {
    background-color: #1e1e1e !important;
    border-color: #3c3c3c !important;
    color: #ffffff !important;
}

html.dark-theme .form-input:hover {
    border-color: #505050 !important;
}

html.dark-theme .form-input:focus {
    border-color: var(--color-primary, #007acc) !important;
    box-shadow: 0 0 0 4px rgba(0, 122, 204, 0.2) !important;
}

html.dark-theme .password-toggle-btn:hover {
    color: #ffffff;
    background-color: #2d2d2d;
}

html.dark-theme .auth-school-logo-fallback {
    background-color: #2d2d2d;
}

html.dark-theme .btn-login {
    background: linear-gradient(135deg, var(--color-primary, #007acc) 0%, var(--color-primary-dark, #005999) 100%);
    box-shadow: 0 4px 12px rgba(0, 122, 204, 0.3);
}

html.dark-theme .btn-login:hover {
    box-shadow: 0 8px 20px rgba(0, 122, 204, 0.45);
}

/* SVG Illustration Theme Overrides */
html.dark-theme .ill-circle-bg {
    fill: rgba(139, 92, 246, 0.08);
}
html.dark-theme .ill-card-bg {
    fill: #252526;
    stroke: rgba(255, 255, 255, 0.06);
}
html.dark-theme .ill-card-header {
    fill: #1d1d1e;
}
html.dark-theme .ill-content-bg {
    fill: #1e1e1e;
    stroke: rgba(255, 255, 255, 0.04);
}
html.dark-theme .ill-float-card {
    fill: #181818;
}
html.dark-theme .ill-badge-bg {
    fill: rgba(255, 255, 255, 0.04);
}
html.dark-theme .ill-text {
    fill: #e2e8f0;
}
html.dark-theme .ill-subtext {
    fill: #94a3b8;
}
html.dark-theme .ill-muted-bg {
    fill: #2d2d2d;
}
html.dark-theme .ill-soft-bg {
    fill: #252526;
}

/* Select Chevron adjustment for dark mode */
html.dark-theme select.form-input {
    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='%23808080' 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");
}

html.dark-theme select.form-input:focus {
    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='%23007acc' 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");
}

/* ============================================================
   ANIMATIONS & RESPONSIVE DESIGN
   ============================================================ */

/* Entrance animation */
@keyframes fadeInCard {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* SVG floating animations */
.ill-float-dashboard {
    animation: floatDashboard 6s ease-in-out infinite;
}

.ill-float-growth {
    animation: floatGrowth 5s ease-in-out infinite;
}

.ill-float-badge {
    animation: floatBadge 5.5s ease-in-out infinite 0.3s;
}

.ill-float-live {
    animation: floatLive 6.5s ease-in-out infinite 0.6s;
}

.ill-float-cap {
    animation: floatCap 7s ease-in-out infinite;
}

@keyframes floatDashboard {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-8px); }
}

@keyframes floatGrowth {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-12px) rotate(-1deg); }
}

@keyframes floatBadge {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-10px) rotate(1.5deg); }
}

@keyframes floatLive {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-6px); }
}

@keyframes floatCap {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-14px) rotate(-2deg); }
}

/* RESPONSIVE LAYOUT BREAKPOINTS */

/* Laptop & Tablet (1024px and below) */
@media (max-width: 1024px) {
    .login-wrapper {
        grid-template-columns: 1fr 1fr;
    }
    .illustration-panel {
        padding: 2rem;
    }
    .branding-title {
        font-size: 1.75rem;
    }
    .branding-description {
        font-size: 0.9rem;
    }
    .form-panel {
        padding: 2rem;
    }
}

/* Smaller Tablets (850px and below) */
@media (max-width: 850px) {
    .login-wrapper {
        grid-template-columns: 1fr; /* Stack visually */
    }
    .illustration-panel {
        display: none; /* Hide left column */
    }
    .form-panel {
        min-height: 100vh;
        width: 100%;
        padding: 1.5rem;
    }
    .auth-card {
        max-width: 480px;
    }
}

/* Mobile Devices (480px and below) */
@media (max-width: 480px) {
    .form-panel {
        padding: 1rem;
    }
    
    .auth-card {
        border-radius: 20px;
        box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
    }
    
    .auth-card-header {
        padding: 2rem 1.5rem 1.25rem;
    }
    
    .auth-card-body {
        padding: 1.5rem 1.5rem 2rem;
    }
    
    .auth-school-name {
        font-size: 1.2rem;
    }
    
    .auth-welcome-title {
        font-size: 1.3rem;
    }
    
    .form-input {
        height: 50px;
        font-size: 14px;
        padding-left: 14px !important;
    }
    
    .password-toggle-btn {
        right: 12px;
    }
    
    .btn-login {
        height: 50px;
        font-size: 14px;
    }
    
    .form-actions {
        flex-direction: row;
        gap: 8px;
        font-size: 13px;
    }
}

