@font-face {
    font-family: 'Cairo';
    src: url('../fonts/cairo-regular.ttf') format('truetype');
    font-weight: 400;
    font-display: swap;
}

@font-face {
    font-family: 'Cairo';
    src: url('../fonts/cairo-bold.ttf') format('truetype');
    font-weight: 700;
    font-display: swap;
}

/* Student Login - Modern Dark/Light Theme (Matches Home) */

:root {
    --green-bright: #6ABD45;
    --green-mid: #39B54A;
    --green-emerald: #006A39;
    --indigo-300: #a5b4fc;
    --indigo-400: #818cf8;
    --indigo-500: #6366f1;
    --indigo-600: #4f46e5;
    --violet: #7c3aed;

    --slate-950: #020617;
    --slate-900: #0f172a;
    --slate-800: #1e293b;
    --slate-700: #334155;

    --bg: var(--slate-950);
    --surface: var(--slate-900);
    --surface-2: var(--slate-800);
    --border: rgba(148, 163, 184, 0.12);
    --border-2: rgba(148, 163, 184, 0.20);
    --text: #f8fafc;
    --text-muted: rgba(248, 250, 252, 0.55);

    --primary: var(--indigo-500);
    --primary-light: var(--indigo-400);
    --primary-grad: linear-gradient(135deg, #6366f1, #7c3aed);
}

body.light {
    --bg: #f0f9eb;
    --surface: #ffffff;
    --surface-2: #e8f5e1;
    --border: rgba(30, 68, 31, 0.10);
    --border-2: rgba(30, 68, 31, 0.18);
    --text: #1E441F;
    --text-muted: rgba(30, 68, 31, 0.60);
    --primary: var(--green-bright);
    --primary-grad: linear-gradient(135deg, #6ABD45, #39B54A);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Cairo', sans-serif;
    background-color: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    position: relative;
    transition: background-color 0.45s, color 0.45s;
}

/* Background Elements */
.bg-container {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.bg-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(var(--border) 1px, transparent 1px),
        linear-gradient(90deg, var(--border) 1px, transparent 1px);
    background-size: 50px 50px;
    mask-image: radial-gradient(circle at center, black, transparent 80%);
    opacity: 0.4;
}

.bg-glow-1 {
    position: absolute;
    top: -10%;
    right: -10%;
    width: 60vw;
    height: 60vw;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.15), transparent 70%);
    filter: blur(80px);
}

.bg-glow-2 {
    position: absolute;
    bottom: -10%;
    left: -10%;
    width: 50vw;
    height: 50vw;
    background: radial-gradient(circle, rgba(124, 58, 237, 0.1), transparent 70%);
    filter: blur(80px);
}

/* Glass Card */
.glass-card {
    width: 100%;
    max-width: 420px;
    margin: 20px;
    padding: 40px;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-2);
    border-radius: 28px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    animation: cardAppear 0.8s cubic-bezier(0.22, 1, 0.36, 1) both;
}

body.light .glass-card {
    background: rgba(255, 255, 255, 0.7);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.1);
}

@keyframes cardAppear {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card-header {
    text-align: center;
    margin-bottom: 35px;
}

.logo-section {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.logo-icon {
    width: 64px;
    height: 64px;
    background: var(--surface-2);
    border-radius: 18px;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 1px solid var(--border-2);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

body.light .logo-icon {
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.05);
}

.card-title {
    font-size: 1.8rem;
    font-weight: 800;
    background: var(--primary-grad);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 8px;
}

.card-subtitle {
    font-size: 0.95rem;
    color: var(--text-muted);
    font-weight: 600;
}

/* Form Styles */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-label {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-muted);
    margin-right: 5px;
}

.input-wrapper {
    position: relative;
}

.form-input {
    width: 100%;
    padding: 16px 20px;
    background: var(--surface-2);
    border: 1px solid var(--border-2);
    border-radius: 15px;
    color: var(--text);
    font-family: inherit;
    font-size: 1.1rem;
    font-weight: 600;
    transition: all 0.3s;
    text-align: center;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--surface);
    box-shadow: 0 0 0 4px var(--primary-dim);
}

.btn-submit {
    margin-top: 10px;
    padding: 16px;
    border: none;
    border-radius: 15px;
    background: var(--primary-grad);
    color: white;
    font-size: 1.1rem;
    font-weight: 800;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.btn-submit:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px var(--primary-glow);
}

.btn-submit:active {
    transform: translateY(-1px);
}

/* Alerts */
.k-alert {
    padding: 12px 18px;
    border-radius: 12px;
    margin-bottom: 20px;
    font-size: 0.9rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 12px;
}

.k-alert-danger {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.k-alert-success {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.2);
    color: #22c55e;
}

/* Footer & Back button */
.card-footer {
    margin-top: 30px;
    text-align: center;
    border-top: 1px solid var(--border);
    padding-top: 20px;
}

.back-link {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: color 0.3s, transform 0.3s;
}

.back-link:hover {
    color: var(--primary);
    transform: translateX(5px);
}

/* Toggle Theme Switch (Mini version) */
.theme-toggle {
    position: absolute;
    top: 25px;
    left: 25px;
}

.toggle-btn {
    background: var(--surface-2);
    border: 1px solid var(--border-2);
    padding: 8px 15px;
    border-radius: 50px;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
}

.toggle-btn:hover {
    background: var(--surface);
    color: var(--text);
}

/* Mobile Adjustments */
@media (max-width: 480px) {
    .glass-card {
        padding: 30px 20px;
    }

    .card-title {
        font-size: 1.5rem;
    }
}