:root {
    --primary-color: #3B82F6;
    --secondary-color: #020617;
    --navy-deep: #050c1f;
    --accent-red: #E11D48;
    --accent-green: #10B981;
    --white: #FFFFFF;
    --text-main: #F8FAFC;
    --text-dim: #94A3B8;
    --glass-border: rgba(255, 255, 255, 0.08);
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Quicksand', sans-serif; }

html { scroll-behavior: smooth; }

body {
    background: url('ema_hero_bg_premium_1773922244560.png') no-repeat center center / cover;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--white);
    position: relative;
    padding: 20px 15px;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background: linear-gradient(135deg, rgba(2, 6, 23, 0.95), rgba(5, 12, 31, 0.85));
    z-index: 0;
}

/* ── CONTAINER ─────────────────────────────────────────────────────── */
.auth-container {
    background: rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    padding: 2.5rem 3rem;
    border-radius: 24px;
    width: 100%;
    max-width: 460px;
    z-index: 1;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5);
    text-align: center;
}

/* Scrollable container for Register page */
.reg-container {
    max-height: 95vh;
    overflow-y: auto;
    padding: 2rem 2.5rem;
    scrollbar-width: thin;
    scrollbar-color: rgba(59, 130, 246, 0.3) transparent;
}
.reg-container::-webkit-scrollbar { width: 4px; }
.reg-container::-webkit-scrollbar-track { background: transparent; }
.reg-container::-webkit-scrollbar-thumb { background: rgba(59, 130, 246, 0.4); border-radius: 4px; }

/* ── LOGO & HEADINGS ────────────────────────────────────────────────── */
.auth-logo { margin-bottom: 18px; }
.auth-logo img { height: 64px; filter: drop-shadow(0 4px 15px rgba(59, 130, 246, 0.3)); }

.auth-title { font-size: 1.75rem; font-weight: 800; margin-bottom: 6px; }
.auth-subtitle { color: var(--text-dim); font-size: 0.875rem; margin-bottom: 28px; line-height: 1.5; }

/* ── TABS ───────────────────────────────────────────────────────────── */
.auth-tabs {
    display: flex;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    padding: 5px;
    margin-bottom: 25px;
    gap: 4px;
}

.auth-tab {
    flex: 1;
    padding: 10px 14px;
    background: transparent;
    border: none;
    color: var(--text-dim);
    font-family: 'Quicksand', sans-serif;
    font-weight: 600;
    font-size: 0.88rem;
    border-radius: 9px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
}

.auth-tab i { font-size: 0.85rem; }

.auth-tab.active {
    background: var(--primary-color);
    color: var(--white);
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
}

/* ── FORMS ──────────────────────────────────────────────────────────── */
.auth-form { display: none; text-align: left; }
.auth-form.active { display: block; animation: fadeIn 0.4s ease; }

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

.form-group { margin-bottom: 1.1rem; }

.form-group label {
    display: block;
    font-size: 0.82rem;
    color: var(--text-dim);
    margin-bottom: 7px;
    font-weight: 700;
    letter-spacing: 0.3px;
}

.label-hint { font-weight: 500; font-size: 0.75rem; color: var(--text-dim); }

.form-control {
    width: 100%;
    padding: 12px 15px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: #fff;
    font-family: 'Quicksand', sans-serif;
    font-size: 0.9rem;
    outline: none;
    transition: all 0.3s ease;
    -webkit-appearance: none;
}

.form-control::placeholder { color: rgba(148, 163, 184, 0.55); }
.form-control:focus {
    border-color: var(--primary-color);
    background: rgba(59, 130, 246, 0.07);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

select.form-control option { background: #1e293b; color: #fff; }

/* ── INPUT WITH PASSWORD TOGGLE ─────────────────────────────────────── */
.input-wrapper { position: relative; }
.input-wrapper .form-control { padding-right: 44px; }

.toggle-pass {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: var(--text-dim);
    transition: color 0.2s;
    font-size: 0.9rem;
    user-select: none;
}
.toggle-pass:hover { color: var(--primary-color); }

/* ── ALERT BOXES ─────────────────────────────────────────────────────── */
.alert-box {
    border-radius: 10px;
    font-size: 0.82rem;
    font-weight: 600;
    text-align: center;
    padding: 0;
    max-height: 0;
    overflow: hidden;
    transition: all 0.35s ease;
    margin-bottom: 0;
}

.alert-box.alert-error {
    background: rgba(225, 29, 72, 0.1);
    border: 1px solid rgba(225, 29, 72, 0.3);
    color: #f87171;
    padding: 10px 14px;
    max-height: 80px;
    margin-bottom: 14px;
}

.alert-box.alert-success {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #6ee7b7;
    padding: 10px 14px;
    max-height: 80px;
    margin-bottom: 14px;
}

/* ── BUTTONS ─────────────────────────────────────────────────────────── */
.btn-auth {
    width: 100%;
    padding: 13px 20px;
    background: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-family: 'Quicksand', sans-serif;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    margin-top: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(59, 130, 246, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-auth:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.5);
}

.btn-teacher { background: var(--accent-red); box-shadow: 0 5px 15px rgba(225, 29, 72, 0.3); }
.btn-teacher:hover { box-shadow: 0 8px 25px rgba(225, 29, 72, 0.5); }

/* ── LINKS ───────────────────────────────────────────────────────────── */
.auth-links { margin-top: 20px; font-size: 0.83rem; color: var(--text-dim); text-align: center; }
.auth-links a { color: var(--primary-color); text-decoration: none; font-weight: 700; }
.auth-links a:hover { text-decoration: underline; }

.forgot-link { font-size: 0.75rem; color: var(--text-dim); text-decoration: none; transition: color 0.2s; }
.forgot-link:hover { color: var(--primary-color); }

.back-link { color: var(--text-dim); text-decoration: none; font-size: 0.8rem; transition: color 0.2s; }
.back-link:hover { color: var(--white); }

/* ── NOTICE TEXT (register info) ────────────────────────────────────── */
.notice-text {
    font-size: 0.8rem;
    color: var(--text-dim);
    background: rgba(59, 130, 246, 0.07);
    border: 1px solid rgba(59, 130, 246, 0.15);
    border-radius: 8px;
    padding: 10px 12px;
    margin-bottom: 15px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    line-height: 1.5;
    text-align: left;
}
.notice-text i { color: var(--primary-color); margin-top: 1px; flex-shrink: 0; }
