/* =====================================================================
   portal.css — Components for the student portal, checkout & admin
   ---------------------------------------------------------------------
   Loaded *after* styles.css, so it reuses the same design tokens
   (colors, radius, shadows). Keeping these here leaves the verified
   core stylesheet untouched. Sections:
     1. Forms & fields        4. Checkout
     2. Auth screens          5. Admin shell
     3. Dashboard / panels    6. Misc (pills, tables, banners)
   ===================================================================== */

/* ---------- 1. FORMS ----------------------------------------------- */
.field { display: grid; gap: 6px; margin-bottom: 16px; }
.field label { font-weight: 600; font-size: .9rem; color: var(--ink); }
.field input, .field select, .field textarea {
  width: 100%; padding: 12px 14px; border: 1px solid var(--border);
  border-radius: 10px; background: var(--bg); color: var(--ink); font: inherit;
}
.field input:focus, .field select:focus { outline: 3px solid var(--blue); outline-offset: 1px; }
.field .hint { font-size: .78rem; color: var(--muted); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 520px) { .form-row { grid-template-columns: 1fr; } }
.demo-note {
  font-size: .82rem; color: var(--ink-soft); background: rgba(37,99,235,.08);
  border: 1px solid rgba(37,99,235,.22); border-radius: 10px; padding: 11px 13px; margin: 14px 0;
}
.demo-note b { color: var(--blue-600); }

/* ---------- 2. AUTH ------------------------------------------------- */
.auth-wrap {
  min-height: 100vh; display: grid; place-items: center; padding: 40px 20px;
  background: radial-gradient(900px 500px at 80% -10%, rgba(37,99,235,.25), transparent 60%),
              linear-gradient(180deg, var(--navy-900), var(--navy));
}
.auth-card {
  width: 100%; max-width: 460px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: clamp(24px, 4vw, 36px); box-shadow: var(--shadow-lg);
}
.auth-brand { display: flex; align-items: center; gap: 10px; justify-content: center; margin-bottom: 18px; }
.auth-brand img { height: 46px; }
.auth-brand span { font-family: var(--font-serif); font-weight: 700; line-height: 1.1; }
.auth-brand small { display: block; font-family: var(--font-sans); font-size: .62rem; letter-spacing: .16em; text-transform: uppercase; color: var(--gold-deep); }
.auth-tabs { display: flex; background: var(--surface-2); border-radius: 999px; padding: 4px; margin-bottom: 22px; }
.auth-tabs button { flex: 1; padding: 11px; border: 0; background: none; border-radius: 999px; font-weight: 600; color: var(--muted); }
.auth-tabs button.active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
.auth-foot { text-align: center; margin-top: 16px; font-size: .9rem; color: var(--muted); }

/* ---------- 3. DASHBOARD / PANELS ---------------------------------- */
.portal-greeting { padding: clamp(26px, 5vw, 44px) 0 6px; }
.portal-greeting h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); }
.portal-greeting p { color: var(--muted); margin-top: 6px; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 22px; box-shadow: var(--shadow-sm); }
.panel + .panel { margin-top: 22px; }
.panel__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.panel__head h2 { font-size: 1.3rem; }
.enrolled-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 18px; }
.enrolled-card { border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; background: var(--bg); }
.enrolled-card__top { padding: 16px 18px; color: #fff; }
.enrolled-card__top h3 { color: #fff; font-size: 1.08rem; }
.enrolled-card__top p { color: rgba(255,255,255,.82); font-size: .85rem; margin-top: 2px; }
.enrolled-card__body { padding: 16px 18px; }
.progress-line { height: 9px; background: var(--surface-2); border-radius: 999px; overflow: hidden; margin: 6px 0 10px; }
.progress-line i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--blue), #60a5fa); border-radius: 999px; transition: width .5s ease; }
.progress-meta { display: flex; justify-content: space-between; font-size: .82rem; color: var(--muted); margin-bottom: 12px; }

/* ---------- 4. CHECKOUT -------------------------------------------- */
.checkout-grid { display: grid; grid-template-columns: 1.4fr .9fr; gap: 26px; align-items: start; }
@media (max-width: 820px) { .checkout-grid { grid-template-columns: 1fr; } }
.summary { position: sticky; top: 90px; }
.summary__row { display: flex; justify-content: space-between; padding: 8px 0; color: var(--ink-soft); font-size: .95rem; }
.summary__row.total { border-top: 2px solid var(--border); margin-top: 8px; padding-top: 14px; }
.summary__row.total b { font-family: var(--font-serif); font-size: 1.5rem; color: var(--ink); }
.secure-badges { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; color: var(--muted); font-size: .8rem; align-items: center; }
.plan-toggle { display: grid; gap: 10px; margin-bottom: 18px; }
.plan-opt { display: flex; gap: 12px; align-items: center; border: 1.5px solid var(--border); border-radius: 12px; padding: 14px; cursor: pointer; }
.plan-opt.sel { border-color: var(--blue); background: var(--blue-50); }
.plan-opt input { accent-color: var(--blue); width: 18px; height: 18px; }
.plan-opt .price { font-size: 1.2rem; margin-left: auto; }

/* ---------- 5. ADMIN ----------------------------------------------- */
.admin-shell { display: grid; grid-template-columns: 240px 1fr; min-height: calc(100vh - var(--header-h)); }
.admin-nav { background: var(--bg-alt); border-right: 1px solid var(--border); padding: 22px 12px; }
.admin-nav__brand { font-weight: 700; font-size: .76rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); padding: 0 10px 12px; }
.admin-nav button { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; background: none; border: 0; padding: 11px 12px; border-radius: 10px; color: var(--ink-soft); font-weight: 500; font-size: .95rem; margin-bottom: 2px; }
.admin-nav button:hover { background: var(--surface-2); }
.admin-nav button.active { background: var(--navy); color: #fff; }
.admin-main { padding: clamp(20px, 4vw, 36px); }
.admin-main h1 { font-size: clamp(1.5rem, 3vw, 2rem); margin-bottom: 6px; }
.tabpanel[hidden] { display: none; }
@media (max-width: 760px) {
  .admin-shell { grid-template-columns: 1fr; }
  .admin-nav { display: flex; overflow-x: auto; gap: 6px; border-right: 0; border-bottom: 1px solid var(--border); }
  .admin-nav__brand { display: none; }
  .admin-nav button { white-space: nowrap; margin: 0; }
}

/* ---------- 6. MISC ------------------------------------------------- */
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 24px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 18px; }
.stat b { font-family: var(--font-serif); font-size: 1.9rem; color: var(--navy); display: block; }
[data-theme="dark"] .stat b { color: var(--gold-soft); }
.stat span { color: var(--muted); font-size: .84rem; }
.stat .delta { font-size: .78rem; font-weight: 700; }
.stat .delta.up { color: var(--ok); } .stat .delta.down { color: var(--warn); }

.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--r); }
.table { width: 100%; border-collapse: collapse; min-width: 520px; }
.table th, .table td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--border); font-size: .92rem; }
.table th { color: var(--muted); font-weight: 700; font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; background: var(--bg-alt); }
.table tr:last-child td { border-bottom: 0; }

.pill { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; font-size: .74rem; font-weight: 700; }
.pill--green { background: rgba(31,157,85,.14); color: var(--ok); }
.pill--amber { background: rgba(201,162,39,.18); color: var(--gold-deep); }
.pill--blue { background: var(--blue-50); color: var(--blue-600); }

.banner { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--r-sm); margin-bottom: 18px; }
.banner--info { background: var(--blue-50); border: 1px solid rgba(37,99,235,.25); color: var(--ink-soft); }
.bar-chart { display: flex; align-items: flex-end; gap: 10px; height: 160px; padding-top: 10px; }
.bar-chart .bar { flex: 1; background: linear-gradient(180deg, var(--blue), #60a5fa); border-radius: 8px 8px 0 0; position: relative; min-height: 6px; }
.bar-chart .bar span { position: absolute; top: -20px; left: 0; right: 0; text-align: center; font-size: .72rem; color: var(--muted); }
.bar-chart .bar small { position: absolute; bottom: -22px; left: 0; right: 0; text-align: center; font-size: .72rem; color: var(--muted); }
