/* --- BASE STYLES & LIGHT THEME --- */
* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Inter', sans-serif; }
body {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    background: #e2e8f0; overflow-x: hidden; overflow-y: auto; 
    -webkit-user-select: none; user-select: none; padding: 20px; 
}
input, textarea, select { -webkit-user-select: auto; user-select: auto; }

/* --- SIMPLE 3-SECOND PRE-LOADER (DARKER THEME) --- */
#study-preloader {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: radial-gradient(circle at center, #334155 0%, #0f172a 100%);
    z-index: 10000; display: flex; flex-direction: column; align-items: center; justify-content: center;
    animation: fadeOutLoader 0.6s ease 3s forwards; 
}
.book-loader {
    animation: floatBook 2s ease-in-out infinite;
    margin-bottom: 20px;
}
.book-loader svg {
    width: 64px; height: 64px; stroke: #38bdf8; 
    animation: pulseStroke 2s infinite;
}
.loader-text {
    font-family: 'Inter', sans-serif; color: #f8fafc; font-size: 16px; font-weight: 500;
    animation: pulseText 2s infinite; letter-spacing: 0.5px; text-align: center; padding: 0 20px;
}
@keyframes floatBook {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}
@keyframes pulseStroke { 0%, 100% { opacity: 0.6; } 50% { opacity: 1; filter: drop-shadow(0 0 8px rgba(56, 189, 248, 0.5)); } }
@keyframes pulseText { 0%, 100% { opacity: 0.5; } 50% { opacity: 1; } }
@keyframes fadeOutLoader { to { opacity: 0; visibility: hidden; } }

/* --- MAIN CONTAINER --- */
.container {
    display: flex; width: 100%; max-width: 1000px; min-height: 600px; background: #ffffff;
    border-radius: 24px; overflow: hidden; box-shadow: 0 20px 50px rgba(0, 0, 0, 0.08);
    z-index: 10; border: 1px solid #ffffff;
    animation: slideUpFade 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
@keyframes slideUpFade { 0% { opacity: 0; transform: translateY(30px); } 100% { opacity: 1; transform: translateY(0); } }

/* --- LEFT PANEL (Ultra Light Gradient) --- */
.left {
    flex: 1; background: linear-gradient(135deg, #ffffff 0%, #eff6ff 100%); color: #1e293b;
    padding: 50px; display: flex; flex-direction: column; position: relative; border-right: 1px solid #f1f5f9;
}

/* --- CSS LOGO (GET MY DREAM) --- */
.logo-wrapper {
    cursor: pointer; margin-bottom: 30px; display: flex; flex-direction: column; user-select: none;
}
.logo-top {
    font-family: 'Orbitron', sans-serif; font-size: 26px; font-weight: 700;
    color: #64748b; letter-spacing: 2px; line-height: 1; transition: all 0.4s ease;
}
.logo-bottom {
    font-family: 'Permanent Marker', cursive; font-size: 46px; line-height: 1;
    background: linear-gradient(90deg, #3b82f6, #8b5cf6, #ec4899, #3b82f6);
    background-size: 300% 300%; -webkit-background-clip: text; color: transparent;
    transition: all 0.4s ease; transform: translateY(-5px) rotate(-2deg);
}
.logo-wrapper:hover .logo-top { color: #0f172a; }
.logo-wrapper:hover .logo-bottom {
    animation: rainbowFlow 2.5s linear infinite; filter: drop-shadow(0 4px 10px rgba(99,102,241,0.25));
    transform: translateY(-5px) rotate(-4deg) scale(1.02);
}
@keyframes rainbowFlow { 0% { background-position: 0% 50%; } 100% { background-position: 100% 50%; } }

.hero-desc { color: #475569; font-size: 15px; line-height: 1.7; max-width: 95%; margin-bottom: 20px;}
.tags-container { margin-top: auto; display: flex; flex-wrap: wrap; gap: 10px; }
.feature-tag {
    background: #f8fafc; border: 1px solid #e2e8f0; padding: 8px 16px; border-radius: 30px; font-size: 13px; font-weight: 500; color: #475569;
    display: flex; align-items: center; gap: 8px; transition: all 0.3s ease;
}
.feature-tag:hover { background: #ffffff; border-color: #3b82f6; box-shadow: 0 4px 12px rgba(59,130,246,0.1); transform: translateY(-2px); color: #0f172a;}
.feature-tag .dot { width: 6px; height: 6px; background: #3b82f6; border-radius: 50%; }

/* --- RIGHT PANEL (Light Form) --- */
.right { flex: 1.1; padding: 60px 80px; display: flex; flex-direction: column; justify-content: center; background: #ffffff; }
.right h2 { font-size: 30px; font-weight: 600; color: #0f172a; margin-bottom: 8px; letter-spacing: -0.5px; }
.right .subtitle { color: #64748b; font-size: 15px; margin-bottom: 40px; }

.input-group { position: relative; margin-bottom: 18px; width: 100%; }
.input-group .icon-left { position: absolute; left: 18px; top: 50%; transform: translateY(-50%); width: 20px; height: 20px; color: #94a3b8; transition: color 0.3s ease; pointer-events: none; }
.input-group .icon-right { position: absolute; right: 18px; top: 50%; transform: translateY(-50%); width: 20px; height: 20px; color: #94a3b8; transition: color 0.3s ease; cursor: pointer; }
.input-group .icon-right:hover { color: #3b82f6; }

.input-group input {
    width: 100%; padding: 16px 48px; border-radius: 12px; border: 1.5px solid #e2e8f0; font-size: 15px; outline: none; transition: all 0.3s ease; background: #f8fafc; color: #0f172a;
}
.input-group input::placeholder { color: #94a3b8; }
.input-group input:focus { border-color: #3b82f6; background: #ffffff; box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1); }
.input-group input:focus ~ .icon-left, .input-group input:not(:placeholder-shown) ~ .icon-left { color: #3b82f6; }

/* Checkbox & Links Row */
.options-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 28px; flex-wrap: wrap; gap: 10px; }
.checkbox-label { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: #64748b; cursor: pointer; font-weight: 500; }
.checkbox-label input[type="checkbox"] { width: 16px; height: 16px; accent-color: #3b82f6; cursor: pointer; }
.forgot-link { font-size: 13.5px; color: #3b82f6; text-decoration: none; font-weight: 500; transition: all 0.2s ease; }
.forgot-link:hover { color: #2563eb; text-decoration: underline; }

/* Primary Button */
.login-btn {
    width: 100%; padding: 16px; background: linear-gradient(135deg, #3b82f6, #4f46e5); color: #ffffff;
    border: none; border-radius: 12px; font-size: 16px; font-weight: 600; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 10px; transition: all 0.3s ease; box-shadow: 0 6px 15px rgba(59, 130, 246, 0.2);
}
.login-btn:hover { transform: translateY(-2px); box-shadow: 0 10px 20px rgba(59, 130, 246, 0.3); }
.login-btn:active { transform: translateY(1px); }

.divider { display: flex; align-items: center; margin: 30px 0; }
.divider div { flex: 1; height: 1px; background: #e2e8f0; }
.divider span { padding: 0 15px; color: #94a3b8; font-size: 13px; font-weight: 500; text-transform: uppercase; letter-spacing: 1px; }

.bottom-text { text-align: center; font-size: 14px; color: #64748b; margin-top: 30px; }
.bottom-text span { color: #3b82f6; font-weight: 600; cursor: pointer; transition: all 0.2s ease; }
.bottom-text span:hover { color: #2563eb; text-decoration: underline; }

.status { color: #ef4444; font-size: 14px; margin-top: 12px; text-align: center; font-weight: 500; width: 100%; }
.status.signup-alert { color: #f59e0b; }

/* --- POPUPS & MODALS (Light Theme) --- */
.popup, .modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(4px); display: none; align-items: center; justify-content: center; z-index: 9999; padding: 20px; 
}
.signup-card, .modal-card {
    background: #ffffff; padding: 40px; border-radius: 20px; box-shadow: 0 25px 50px rgba(0,0,0,0.15); 
    transform: translateY(20px); animation: slideUpFade 0.4s ease forwards;
}

.signup-card { width: 100%; max-width: 440px; max-height: 90vh; overflow-y: auto; }
.modal-card { width: 100%; max-width: 400px; text-align: center; position: relative; }

.signup-card h2 { margin-bottom: 24px; color: #0f172a; font-size: 24px; font-weight: 600; }
.signup-card input, .signup-card select, .modal-input {
    width: 100%; padding: 14px 16px; margin: 8px 0; border: 1.5px solid #e2e8f0; border-radius: 10px; background: #f8fafc; color: #0f172a; font-size: 14px; transition: all 0.3s ease; outline: none;
}
.signup-card input:focus, .signup-card select:focus, .modal-input:focus { border-color: #3b82f6; background: #ffffff; box-shadow: 0 0 0 3px rgba(59,130,246,0.1); }
.signup-card select { color: #1e293b; }

.signup-card button, .modal-btn {
    width: 100%; padding: 14px; background: linear-gradient(135deg, #3b82f6, #4f46e5); color: #ffffff; border: none; border-radius: 10px; margin-top: 15px; cursor: pointer; font-weight: 600; font-size: 15px; transition: all 0.3s ease;
}
.signup-card button:hover, .modal-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 15px rgba(59,130,246,0.25); }

/* Password Strength Meter */
.strength-meter { display: flex; gap: 6px; margin-top: -2px; margin-bottom: 12px; height: 4px; padding: 0 4px; }
.strength-bar { flex: 1; background: #e2e8f0; border-radius: 4px; transition: background 0.3s ease; }

.hidden { display: none; }
.modal-overlay.active { display: flex; }
.close-modal { position: absolute; top: 18px; right: 18px; background: none; border: none; font-size: 20px; color: #94a3b8; cursor: pointer; transition: color 0.2s; }
.close-modal:hover { color: #ef4444; }
.modal-msg { font-size: 14px; margin-top: 12px; min-height: 20px; font-weight: 500; }
.msg-error { color: #ef4444; }
.msg-success { color: #22c55e; }

/* Emojis matching light theme - fixed position */
.emoji { position: fixed; font-size: 24px; opacity: 0.15; pointer-events: none; z-index: 0; transition: transform 0.3s ease; }

/* =========================================
   📱 RESPONSIVE MEDIA QUERIES
   ========================================= */
@media (max-width: 900px) {
    .container { flex-direction: column; height: auto; min-height: auto; }
    .left { padding: 40px 30px; border-radius: 24px 24px 0 0; border-right: none; border-bottom: 1px solid #f1f5f9; }
    .right { padding: 40px 30px; border-radius: 0 0 24px 24px; }
}

@media (max-width: 480px) {
    body { padding: 10px; }
    .left { padding: 35px 20px; }
    .right { padding: 35px 20px; }
    .logo-top { font-size: 22px; }
    .logo-bottom { font-size: 38px; }
    .hero-desc { font-size: 14px; }
    .right h2 { font-size: 26px; }
    .right .subtitle { font-size: 14px; margin-bottom: 30px; }
    .input-group input { padding: 14px 14px 14px 44px; font-size: 14px; } 
    .login-btn { padding: 14px; font-size: 15px; }
    .signup-card, .modal-card { padding: 30px 20px; }
    .signup-card h2 { font-size: 22px; }
    .options-row { flex-direction: column; align-items: flex-start; gap: 15px; }
    .forgot-link { align-self: flex-start; }
}