/* Landing page and login pages */
.auth-page {
    margin: 0;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: #1f2937;
    background: #0b1f4d linear-gradient(135deg, #0b1f4d 0%, #16306e 60%, #0b1f4d 100%);
    -webkit-font-smoothing: antialiased;
}

.auth-page *, .auth-page *::before, .auth-page *::after { box-sizing: border-box; }

/* ---------- login card ---------- */
.auth-card {
    width: 100%;
    max-width: 420px;
    background: #fff;
    border-radius: 20px;
    border-top: 6px solid #f3cd46;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
    overflow: hidden;
}

.auth-top { padding: 26px 28px 6px; text-align: center; }

.auth-logo {
    width: 64px;
    height: 64px;
    margin: 0 auto 12px;
    display: block;
    object-fit: contain;
    background: #fff;
    border: 1px solid #e3e8f2;
    border-radius: 16px;
    padding: 4px;
}

.auth-mark {
    width: 64px;
    height: 64px;
    margin: 0 auto 12px;
    border-radius: 16px;
    background: #f3cd46;
    color: #3b2f00;
    font-size: 30px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-school { margin: 0; font-size: 14px; font-weight: 600; color: #5b6678; }
.auth-title { margin: 6px 0 0; font-size: 26px; color: #0b1f4d; }
.auth-body { padding: 14px 28px 28px; }

.auth-error {
    background: #fef2f2;
    color: #7f1d1d;
    border: 1px solid #fecaca;
    padding: 12px 14px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    margin: 8px 0 0;
}

.auth-label { display: block; margin: 16px 0 6px; font-size: 14px; font-weight: 700; color: #0b1f4d; }

.auth-input {
    width: 100%;
    padding: 13px 14px;
    font-size: 16px; /* 16px stops phones zooming in when a field is tapped */
    color: #1f2937;
    background: #fff;
    border: 1.5px solid #cbd5e1;
    border-radius: 12px;
    margin: 0;
}

.auth-input:focus { outline: 3px solid rgba(243, 205, 70, 0.65); border-color: #0b1f4d; }

.password-wrapper { position: relative; }
.password-wrapper .auth-input { padding-right: 52px; }

.toggle-password {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: #64748b;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 0;
}

.toggle-password:hover { background: #eef2f9; }
.toggle-password.active { color: #0b1f4d; background: #eaf0ff; }
.toggle-password svg { width: 22px; height: 22px; }

.auth-btn {
    width: 100%;
    margin: 22px 0 0;
    padding: 14px;
    border: 0;
    border-radius: 12px;
    background: #0b1f4d;
    color: #fff;
    font-size: 16px;
    font-weight: 800;
    cursor: pointer;
    transition: background 0.2s;
}

.auth-btn:hover { background: #16306e; }
.auth-btn:focus-visible { outline: 3px solid rgba(243, 205, 70, 0.8); outline-offset: 2px; }

.auth-help { margin: 18px 0 0; font-size: 13px; color: #5b6678; text-align: center; }
.auth-back { display: block; margin-top: 14px; text-align: center; font-size: 14px; font-weight: 700; color: #0b1f4d; text-decoration: none; }
.auth-back:hover { text-decoration: underline; }

/* ---------- landing page ---------- */
.landing-wrap { width: 100%; max-width: 960px; margin: 0 auto; }
.landing-brand { text-align: center; color: #fff; margin-bottom: 28px; }
.landing-brand .auth-mark { margin-bottom: 14px; }
.landing-brand h1 { margin: 0; font-size: 34px; letter-spacing: 0.02em; }
.landing-brand p { margin: 8px 0 0; font-size: 16px; color: #c9d6f5; }

.portal-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }

.portal-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: #fff;
    border-radius: 18px;
    padding: 24px;
    text-decoration: none;
    color: #1f2937;
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.25);
    transition: transform 0.15s, box-shadow 0.15s;
}

.portal-card:hover { transform: translateY(-4px); box-shadow: 0 20px 44px rgba(0, 0, 0, 0.32); }
.portal-card:focus-visible { outline: 3px solid #f3cd46; outline-offset: 3px; }

.portal-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: #eaf0ff;
    color: #0b1f4d;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 6px;
}

.portal-card.student .portal-icon { background: #f3cd46; color: #3b2f00; }
.portal-icon svg { width: 26px; height: 26px; }
.portal-card h2 { margin: 0; font-size: 20px; color: #0b1f4d; }
.portal-card p { margin: 0; font-size: 14px; color: #5b6678; line-height: 1.5; }
.portal-go { margin-top: auto; padding-top: 10px; font-weight: 800; font-size: 14px; color: #0b1f4d; }
.landing-foot { text-align: center; margin-top: 26px; font-size: 13px; color: #9fb2e6; }

@media (max-width: 760px) {
    .portal-grid { grid-template-columns: 1fr; }
    .landing-brand h1 { font-size: 26px; }
    .auth-page.landing { align-items: flex-start; }
    .auth-top { padding: 22px 20px 4px; }
    .auth-body { padding: 12px 20px 24px; }
}
