/* Styles for the student account pages: login, reset password, student portal, admin.
   Same colour system as css/site.css: navy, brand blue, logo orange for buying. */
* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --navy-950: #060d22;
  --navy-900: #0b1736;
  --navy-800: #13244d;
  --bg: #f4f7fc;
  --surface: #ffffff;
  --ink: #0f172a;
  --text: #334155;
  --muted: #5b6b82;
  --faint: #7a879b;
  --blue: #1f6feb;
  --blue-soft: #e8f0ff;
  --orange: #ff9a1f;
  --line: #e3e9f3;
  --card: #ffffff;
  --green: #15803d;
  --gold: #b45309;
  --red: #dc2626;
  --on-dark: #eef3ff;
  --on-dark-muted: #b4c2dc;
  --shadow: 0 1px 2px rgba(15,23,42,0.05), 0 8px 24px rgba(15,23,42,0.07);
}
body { font-family: 'Space Grotesk', Arial, sans-serif; background: var(--bg); color: var(--text); min-height: 100vh; display: flex; flex-direction: column; overflow-x: hidden; line-height: 1.5; }
a { color: var(--blue); }
button, input, select, textarea { font-family: inherit; }
[hidden] { display: none !important; }

/* Nav (matches the main website) */
nav { display: flex; align-items: center; justify-content: space-between; padding: 12px 40px; height: 72px; background: rgba(6,13,34,0.96); border-bottom: 1px solid rgba(255,255,255,0.08); position: sticky; top: 0; z-index: 100; }
.nav-logo { display: block; }
.nav-logo img { height: 48px; width: auto; display: block; }
.nav-links { display: flex; gap: 28px; }
.nav-links a { color: var(--on-dark-muted); font-size: 15px; font-weight: 500; text-decoration: none; }
.nav-links a:hover, .nav-links a.active { color: #fff; }
.nav-cta { background: var(--orange); color: #1b1203; font-size: 14px; font-weight: 700; padding: 10px 18px; border-radius: 12px; text-decoration: none; }
.hamburger { display: none; flex-direction: column; gap: 5px; cursor: pointer; padding: 6px; background: none; border: none; }
.hamburger span { display: block; width: 24px; height: 2px; background: #fff; border-radius: 2px; transition: all 0.3s; }
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
.mobile-menu { display: none; flex-direction: column; background: var(--navy-950); max-height: 0; overflow: hidden; transition: max-height 0.35s ease, padding 0.3s ease; padding: 0 18px; }
.mobile-menu.open { max-height: 500px; padding: 10px 18px 16px; }
.mobile-menu a { color: var(--on-dark); font-size: 16px; text-decoration: none; padding: 13px 0; border-bottom: 1px solid rgba(255,255,255,0.06); }

main { flex: 1; width: 100%; max-width: 1100px; margin: 0 auto; padding: 48px 24px 72px; }
footer { background: var(--navy-950); padding: 24px 40px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; font-size: 13.5px; color: var(--on-dark-muted); }
footer a { color: var(--on-dark-muted); text-decoration: none; }
footer a:hover { color: #fff; }

h1, h2, h3 { color: var(--ink); }
h1 { font-family: 'Syne', sans-serif; font-weight: 800; font-size: clamp(26px, 4vw, 36px); margin-bottom: 8px; line-height: 1.15; }
h2 { font-family: 'Syne', sans-serif; font-weight: 800; font-size: 20px; margin-bottom: 14px; }
.lead { color: var(--muted); font-size: 15.5px; line-height: 1.6; }
.section { margin-top: 40px; }
.section-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.section-head h2 { margin-bottom: 0; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 22px; box-shadow: var(--shadow); }

/* Forms */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; font-size: 14px; font-weight: 600; color: var(--ink); }
.field small { color: var(--muted); font-size: 12.5px; font-weight: 400; }
.input { width: 100%; background: #fff; border: 1.5px solid #cbd5e1; color: var(--ink); padding: 12px 14px; border-radius: 10px; font-size: 15px; outline: none; font-weight: 400; }
.input::placeholder { color: var(--faint); }
.input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(31,111,235,0.15); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; color: var(--text); line-height: 1.5; margin-bottom: 16px; }
.check input { margin-top: 3px; width: 16px; height: 16px; accent-color: var(--blue); flex-shrink: 0; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1.5px solid transparent; border-radius: 10px; padding: 11px 20px; font-size: 14.5px; font-weight: 700; cursor: pointer; text-decoration: none; transition: background 0.15s, transform 0.15s; }
.btn:hover:not(:disabled) { transform: translateY(-1px); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover:not(:disabled) { background: #1a5fd0; }
.btn-ghost { background: #fff; color: var(--blue); border-color: #bcd2fb; }
.btn-ghost:hover { background: var(--blue-soft); }
.btn-danger { background: #fff; color: var(--red); border-color: #f5b5b5; }
.btn-danger:hover { background: #fef2f2; }
.btn-whatsapp { background: #25d366; color: #fff; }
.btn-whatsapp:hover { background: #1fbd5b; }
.btn-sm { padding: 7px 12px; font-size: 13px; border-radius: 8px; }
.btn-block { width: 100%; }
.link-btn { background: none; border: none; color: var(--blue); cursor: pointer; font-size: 14px; padding: 0; text-decoration: underline; font-weight: 600; }

.msg { padding: 11px 14px; border-radius: 10px; font-size: 14px; line-height: 1.5; margin-bottom: 14px; }
.msg-info { background: var(--blue-soft); border: 1px solid #c3d6fb; color: #1e3a8a; }
.msg-success { background: #ecfdf3; border: 1px solid #a6e9c3; color: #166534; }
.msg-error { background: #fef2f2; border: 1px solid #f5b5b5; color: #991b1b; }

/* Login page */
.auth-wrap { max-width: 440px; margin: 0 auto; }
.auth-card { background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 30px 28px; box-shadow: var(--shadow); }
.tabs { display: grid; grid-template-columns: 1fr 1fr; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 4px; margin-bottom: 22px; }
.tab { background: none; border: none; color: var(--muted); padding: 10px; border-radius: 9px; font-size: 14.5px; font-weight: 700; cursor: pointer; }
.tab.active { background: #fff; color: var(--ink); box-shadow: 0 1px 4px rgba(15,23,42,0.12); }
.auth-foot { text-align: center; margin-top: 16px; font-size: 14px; color: var(--muted); }

/* Dashboard */
.welcome { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 16px; }
.access-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.access-card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 22px; display: flex; flex-direction: column; gap: 10px; box-shadow: var(--shadow); }
.access-card.unlocked { border-color: #9ee2b8; box-shadow: 0 0 0 3px #ecfdf3, var(--shadow); }
.access-icon { font-size: 30px; }
.access-title { font-weight: 700; font-size: 16.5px; color: var(--ink); }
.access-desc { color: var(--muted); font-size: 14px; line-height: 1.55; flex: 1; }
.badge { display: inline-block; font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 20px; }
.badge-on { background: #dcfce7; color: var(--green); }
.badge-off { background: #eef2f7; color: var(--muted); }
.badge-gold { background: #fff1de; color: var(--gold); }
.badge-red { background: #fee2e2; color: var(--red); }
.plans-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; }
.plan-card { background: var(--card); border: 1px solid var(--line); border-top: 4px solid var(--orange); border-radius: 16px; padding: 22px; display: flex; flex-direction: column; gap: 8px; box-shadow: var(--shadow); }
.plan-name { font-family: 'Syne', sans-serif; font-weight: 800; font-size: 18px; color: var(--ink); }
.plan-price { font-family: 'Syne', sans-serif; font-size: 28px; font-weight: 800; color: var(--ink); }
.plan-price small { font-family: 'Space Grotesk', sans-serif; font-size: 13.5px; color: var(--muted); font-weight: 500; }
.plan-desc { color: var(--muted); font-size: 14px; line-height: 1.55; flex: 1; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 20px; background: var(--blue-soft); color: var(--blue); }

/* Tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: var(--shadow); }
table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: 0.6px; color: var(--muted); padding: 12px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; background: #f8fafc; }
td { padding: 12px 14px; border-bottom: 1px solid #eef2f7; vertical-align: top; color: var(--text); }
td b { color: var(--ink); }
tr:last-child td { border-bottom: none; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.empty { color: var(--muted); padding: 22px; text-align: center; font-size: 14.5px; }

/* Admin */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; }
.stat b { display: block; font-family: 'Syne', sans-serif; font-size: 28px; color: var(--ink); }
.stat span { color: var(--muted); font-size: 13.5px; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar .input { max-width: 320px; }
.plan-edit { display: grid; grid-template-columns: 1.4fr 2fr 0.7fr 0.7fr; gap: 10px; align-items: start; }
.plan-edit-row { border-bottom: 1px solid var(--line); padding: 16px; }
.plan-edit-row:last-child { border-bottom: none; }
.plan-edit-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 10px; }
.inline-checks { display: flex; gap: 16px; flex-wrap: wrap; font-size: 14px; color: var(--text); }
.inline-checks label { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.inline-checks input { accent-color: var(--blue); width: 15px; height: 15px; }

/* Dialog */
dialog { background: #fff; color: var(--text); border: 1px solid var(--line); border-radius: 18px; padding: 0; width: min(480px, calc(100% - 32px)); margin: auto; box-shadow: 0 30px 60px rgba(6,13,34,0.35); }
dialog::backdrop { background: rgba(6,13,34,0.55); }
.dialog-head { padding: 18px 22px; border-bottom: 1px solid var(--line); font-weight: 700; font-size: 16.5px; color: var(--ink); }
.dialog-body { padding: 20px 22px 6px; }
.dialog-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 0 22px 20px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.loading { color: var(--muted); padding: 40px 0; text-align: center; }

@media (max-width: 760px) {
  .plan-edit { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  nav { padding: 12px 18px; }
  .nav-links, .nav-cta { display: none; }
  .hamburger { display: flex; }
  .mobile-menu { display: flex; }
  main { padding: 32px 16px 52px; }
  footer { padding: 20px 18px; }
  .auth-card { padding: 24px 18px; }
  .grid-2, .plan-edit { grid-template-columns: 1fr; }
}

/* ───────── Student portal (dashboard.html) ───────── */
body.portal { display: block; }
.portal-shell { display: grid; grid-template-columns: 252px 1fr; min-height: 100vh; }
.side { background: linear-gradient(180deg, var(--navy-950), var(--navy-900)); padding: 20px 14px; display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.side-logo { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; text-decoration: none; color: #fff; }
.side-logo img { height: 46px; width: auto; }
.side-logo span { font-size: 12.5px; color: var(--on-dark-muted); line-height: 1.3; font-weight: 600; }
.side-link { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 10px; color: var(--on-dark-muted); text-decoration: none; font-size: 15px; font-weight: 500; }
.side-link:hover { background: rgba(255,255,255,0.06); color: #fff; }
.side-link.active { background: var(--blue); color: #fff; box-shadow: 0 6px 16px rgba(31,111,235,0.35); }
.side-link .ico { width: 22px; text-align: center; font-size: 16px; }
.side-link .ext { margin-left: auto; font-size: 11px; color: var(--on-dark-muted); }
.side-sep { height: 1px; background: rgba(255,255,255,0.08); margin: 10px 4px; }
.side-user { margin-top: auto; padding: 12px; border-radius: 12px; background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.08); font-size: 13px; color: var(--on-dark-muted); }
.side-user b { display: block; font-size: 14.5px; margin-bottom: 2px; word-break: break-word; color: #fff; }
.side-user span { word-break: break-all; }
.side-user button { margin-top: 10px; width: 100%; background: transparent; color: #fff; border-color: rgba(255,255,255,0.25); }
.side-user button:hover { background: rgba(255,255,255,0.08); }
.portal-main { min-width: 0; }
.topbar { display: none; }
.view { max-width: 1060px; margin: 0 auto; padding: 36px 32px 64px; }
.view-head { margin-bottom: 24px; }
.view-head h1 { margin-bottom: 4px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 18px; box-shadow: var(--shadow); border-left: 4px solid var(--blue); }
.kpi:nth-child(2) { border-left-color: var(--orange); }
.kpi:nth-child(3) { border-left-color: #16a34a; }
.kpi:nth-child(4) { border-left-color: #7c3aed; }
.kpi b { display: block; font-family: 'Syne', sans-serif; font-size: 26px; color: var(--ink); }
.kpi span { color: var(--muted); font-size: 13.5px; }
.test-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.test-card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 20px; display: flex; flex-direction: column; gap: 10px; box-shadow: var(--shadow); }
.test-card h3 { font-size: 16.5px; line-height: 1.4; }
.test-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--muted); font-size: 13.5px; }
.test-meta b { color: var(--ink); }
.test-card .btn { align-self: flex-start; margin-top: auto; }
.banner { display: flex; gap: 14px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 16px 18px; border-radius: 14px; background: #fff8eb; border: 1px solid #f6d9a8; margin-bottom: 18px; font-size: 14.5px; color: #6b4a12; }
.score-pill { font-weight: 700; color: var(--ink); }
.drawer-backdrop { display: none; }

@media (max-width: 900px) {
  .portal-shell { grid-template-columns: 1fr; }
  .side { position: fixed; left: 0; top: 0; bottom: 0; width: 270px; z-index: 200; transform: translateX(-100%); transition: transform 0.25s ease; }
  .side.open { transform: translateX(0); box-shadow: 8px 0 30px rgba(0,0,0,0.4); }
  .drawer-backdrop.open { display: block; position: fixed; inset: 0; background: rgba(6,13,34,0.5); z-index: 150; }
  .topbar { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; background: rgba(6,13,34,0.96); position: sticky; top: 0; z-index: 100; }
  .topbar img { height: 40px; }
  .topbar button { background: none; border: 1px solid rgba(255,255,255,0.25); color: #fff; border-radius: 8px; padding: 7px 11px; font-size: 18px; cursor: pointer; }
  .view { padding: 24px 16px 48px; }
}

/* Portal: study materials & simulations */
.mat-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.mat-tab { background: #fff; border: 1px solid var(--line); color: var(--text); border-radius: 10px; padding: 9px 14px; font-size: 14.5px; font-weight: 700; cursor: pointer; }
.mat-tab:hover { border-color: #bcd2fb; }
.mat-tab.active { background: var(--navy-900); color: #fff; border-color: var(--navy-900); }
.mat-tab .count { font-weight: 500; opacity: 0.7; margin-left: 4px; }
.mat-filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 18px; }
.mat-filters .input { max-width: 300px; padding: 9px 12px; font-size: 14.5px; }
.pill { background: #fff; border: 1px solid #cbd5e1; color: var(--text); border-radius: 20px; padding: 7px 14px; font-size: 13.5px; cursor: pointer; font-weight: 600; }
.pill.active { background: var(--blue); color: #fff; border-color: var(--blue); }
.mat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.mat-item { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px; display: flex; flex-direction: column; gap: 10px; box-shadow: var(--shadow); }
.mat-item-title { font-weight: 700; font-size: 15px; line-height: 1.4; color: var(--ink); }
.mat-item-actions { display: flex; gap: 8px; margin-top: auto; }
.new-tag { font-size: 10.5px; font-weight: 700; padding: 2px 8px; border-radius: 10px; background: #dcfce7; color: var(--green); margin-left: 6px; vertical-align: middle; }

/* Sign-up email typo hint */
.email-hint { margin: -6px 0 14px; padding: 9px 12px; border-radius: 10px; background: #fff7ed; border: 1px solid #fdd6a8; color: #9a3412; font-size: 13.5px; line-height: 1.5; }
.email-hint .link-btn { margin-left: 6px; font-weight: 700; }
