@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 40%, #6366F1 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 30% 40%, rgba(99,102,241,0.08) 0%, transparent 50%),
                radial-gradient(circle at 70% 60%, rgba(139,92,246,0.08) 0%, transparent 50%);
    pointer-events: none;
}

.container {
    width: 100%;
    max-width: 460px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    animation: fadeUp 0.6s ease;
    border: 1px solid rgba(255,255,255,0.2);
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(30px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.form-container {
    padding: 40px;
}

.logo-section {
    text-align: center;
    margin-bottom: 28px;
}

.logo-placeholder {
    width: 80px;
    height: 80px;
    border: 3px solid var(--primary, #6366F1);
    border-radius: 50%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    box-shadow: 0 4px 20px rgba(99,102,241,0.2);
}

.system-title {
    font-size: 24px;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 4px;
    letter-spacing: -0.5px;
}

.form-title {
    font-size: 14px;
    color: #64748b;
    font-weight: 500;
}

.role-switch {
    display: flex;
    gap: 6px;
    margin-bottom: 20px;
    background: #f1f5f9;
    padding: 5px;
    border-radius: 14px;
}

.role-switch a {
    flex: 1;
    text-align: center;
    padding: 9px 12px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    color: #64748b;
    transition: all 0.3s;
    letter-spacing: 0.2px;
    text-transform: uppercase;
}

.role-switch a:hover { background: rgba(255,255,255,0.7); }

.role-switch a.active {
    color: white;
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
    transform: translateY(-1px);
}

.role-switch a[data-role="student"].active { background: linear-gradient(135deg, #6366F1, #4F46E5); }
.role-switch a[data-role="staff"].active { background: linear-gradient(135deg, #10B981, #059669); }
.role-switch a[data-role="admin"].active { background: linear-gradient(135deg, #EF4444, #DC2626); }

.role-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 20px;
    padding: 12px 16px;
    border-radius: 12px;
    color: white;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.role-header i { font-size: 18px; }

.input-group {
    margin-bottom: 18px;
}

.input-group label {
    display: block;
    margin-bottom: 6px;
    color: #475569;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.input-group input,
.input-group select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    background: #ffffff;
    border-radius: 12px;
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    transition: all 0.25s;
    outline: none;
    color: #0f172a;
}

.input-group input::placeholder {
    color: #94a3b8;
}

.input-group input:focus,
.input-group select:focus {
    border-color: #6366F1;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.btn {
    width: 100%;
    padding: 13px;
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 700;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 8px;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
}

.btn:active {
    transform: scale(0.97);
}

.forgot-password {
    display: block;
    text-align: right;
    margin-top: -10px;
    margin-bottom: 18px;
}

.forgot-password a {
    color: #6366F1;
    text-decoration: none;
    font-size: 12px;
    font-weight: 600;
}

.forgot-password a:hover {
    text-decoration: underline;
}

.form-switch {
    text-align: center;
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid #e2e8f0;
}

.form-switch p {
    color: #64748b;
    font-size: 13px;
}

.form-switch a {
    color: #6366F1;
    text-decoration: none;
    font-weight: 700;
    margin-left: 4px;
}

.form-switch a:hover {
    text-decoration: underline;
}

.btn.loading {
    opacity: 0.7;
    cursor: not-allowed;
}

.btn.loading::after {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid white;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 0.7s linear infinite;
    margin-left: 10px;
    vertical-align: middle;
}

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

.alert {
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.alert-error {
    background: #FEF2F2;
    color: #991B1B;
    border: 1px solid #FECACA;
}

.alert-success {
    background: #F0FDF4;
    color: #166534;
    border: 1px solid #BBF7D0;
}

/* Home page */
.home-container {
    max-width: 520px;
    text-align: center;
}

.home-title {
    font-size: 28px;
    font-weight: 800;
    color: white;
    margin-bottom: 4px;
    letter-spacing: -0.5px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.home-subtitle {
    font-size: 14px;
    color: rgba(255,255,255,0.7);
    margin-bottom: 28px;
    line-height: 1.6;
}

.role-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 4px;
}

.role-btn {
    width: 100%;
    padding: 16px;
    border: none;
    border-radius: 16px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.35s;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-family: 'Inter', sans-serif;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.role-btn:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.25);
}

.role-btn:active {
    transform: scale(0.98);
}

.role-btn i {
    font-size: 20px;
    width: 24px;
}

.btn-student {
    background: linear-gradient(135deg, #6366F1, #4F46E5);
    color: white;
    box-shadow: 0 4px 16px rgba(99,102,241,0.3);
}

.btn-staff {
    background: linear-gradient(135deg, #10B981, #059669);
    color: white;
    box-shadow: 0 4px 16px rgba(16,185,129,0.3);
}

.btn-admin {
    background: linear-gradient(135deg, #EF4444, #DC2626);
    color: white;
    box-shadow: 0 4px 16px rgba(239,68,68,0.3);
}

.home-footer {
    margin-top: 24px;
    padding-top: 18px;
    border-top: 1px solid rgba(255,255,255,0.15);
    font-size: 13px;
    color: rgba(255,255,255,0.5);
}

@media (max-width: 480px) {
    body { padding: 12px; }
    .container { border-radius: 18px; }
    .form-container { padding: 28px 20px; }
    .system-title { font-size: 20px; }
    .form-title { font-size: 13px; }
    .logo-placeholder { width: 64px; height: 64px; }
    .home-title { font-size: 22px; }
    .role-btn { padding: 14px; font-size: 13px; border-radius: 12px; }
    .role-switch a { font-size: 11px; padding: 7px 8px; }
}
