/* ==========================================================================
   SS Medical Foundation — Student portal (login + dashboard)
   Extends the main design system tokens in styles.css.
   ========================================================================== */

/* ----- Auth (login / register) ----------------------------------------- */
.auth-wrap {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: 1fr;
  background: var(--paper);
}
@media (min-width: 900px) { .auth-wrap { grid-template-columns: 1.05fr 1fr; } }

.auth-aside {
  display: none;
  background: var(--ink);
  color: var(--on-dark);
  padding: clamp(2rem, 5vw, 4rem);
  position: relative;
  overflow: clip;
}
@media (min-width: 900px) { .auth-aside { display: flex; flex-direction: column; } }
.auth-aside::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(70% 60% at 90% 5%, rgba(216,162,74,.18), transparent 55%);
}
.auth-aside > * { position: relative; z-index: 1; }
.auth-aside h2 { color: #fff; margin-top: 1.4rem; max-width: 18ch; }
.auth-aside p { color: var(--on-dark-mut); margin-top: 1rem; max-width: 42ch; }
.auth-points { margin-top: 2rem; display: grid; gap: 1rem; }
.auth-point { display: flex; gap: .8rem; align-items: flex-start; }
.auth-point .dot { color: var(--gold); font-family: var(--font-mono); flex: 0 0 auto; }
.auth-point b { color: #fff; font-weight: 600; }
.auth-point span { display: block; color: var(--on-dark-mut); font-size: .9rem; }

.auth-main {
  display: flex; align-items: center; justify-content: center;
  padding: clamp(1.6rem, 5vw, 3rem);
}
.auth-card { width: 100%; max-width: 420px; }
.auth-card .brand { margin-bottom: 1.6rem; }

.auth-tabs { display: flex; gap: .3rem; background: var(--mint-2); padding: .3rem; border-radius: 12px; margin-bottom: 1.6rem; }
.auth-tab {
  flex: 1; text-align: center; padding: .6rem; border-radius: 9px; border: 0; background: transparent;
  font-weight: 600; color: var(--sage); font-size: .95rem;
}
.auth-tab.active { background: #fff; color: var(--ink); box-shadow: var(--shadow); }

.auth-form { display: none; }
.auth-form.active { display: block; }
.auth-form h1 { font-size: var(--step-2); margin-bottom: .4rem; }
.auth-form .sub { color: var(--sage); margin-bottom: 1.4rem; font-size: .95rem; }
.auth-form .btn { width: 100%; justify-content: center; margin-top: .4rem; }
.auth-alt { text-align: center; margin-top: 1.2rem; font-size: .9rem; color: var(--sage); }
.auth-demo { margin-top: 1rem; text-align: center; }
.auth-demo button {
  background: transparent; border: 1px dashed var(--line); color: var(--forest);
  padding: .6rem 1rem; border-radius: 10px; font-weight: 600; font-size: .85rem; width: 100%;
}
.auth-demo button:hover { border-color: var(--emerald); background: var(--mint-2); }
.auth-back { display: inline-block; margin-top: 1.4rem; font-size: .85rem; }

/* ----- Dashboard shell -------------------------------------------------- */
.app-bar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.92); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.app-bar .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-block: .7rem; }
.app-user { display: flex; align-items: center; gap: .8rem; font-size: .9rem; }
.app-user .who { text-align: right; line-height: 1.2; }
.app-user .who b { display: block; font-weight: 600; }
.app-user .who span { color: var(--sage); font-size: .78rem; }
.app-user .avatar {
  width: 38px; height: 38px; border-radius: 50%; background: var(--forest); color: #fff;
  display: grid; place-items: center; font-weight: 700; font-family: var(--font-display);
}
.btn--sm { padding: .5em .9em; font-size: .85rem; }

.portal-hero { background: var(--ink); color: var(--on-dark); padding-block: clamp(1.8rem,4vw,2.8rem); }
.portal-hero h1 { color: #fff; font-size: var(--step-2); }
.portal-hero p { color: var(--on-dark-mut); margin-top: .4rem; max-width: 60ch; }
.portal-hero .pill-row { margin-top: 1rem; display: flex; flex-wrap: wrap; gap: .5rem; }
.portal-hero .chip {
  font-family: var(--font-mono); font-size: .72rem; letter-spacing: .04em;
  padding: .3em .7em; border-radius: 999px; background: rgba(255,255,255,.08);
  border: 1px solid var(--line-dk); color: var(--on-dark);
}

/* Module tabs */
.mod-tabs {
  position: sticky; top: 56px; z-index: 40; background: var(--paper);
  border-bottom: 1px solid var(--line); overflow-x: auto;
}
.mod-tabs .wrap { display: flex; gap: .2rem; padding-block: 0; }
.mod-tab {
  white-space: nowrap; border: 0; background: transparent; cursor: pointer;
  padding: .95rem .9rem; font-weight: 600; font-size: .92rem; color: var(--sage);
  border-bottom: 2.5px solid transparent;
}
.mod-tab .ic { margin-right: .4rem; }
.mod-tab:hover { color: var(--forest); }
.mod-tab.active { color: var(--ink); border-bottom-color: var(--coral); }

/* Panels */
.panel { display: none; padding-block: clamp(1.6rem, 4vw, 2.6rem); }
.panel.active { display: block; }
.panel-head { margin-bottom: 1.4rem; }
.panel-head .eyebrow { margin-bottom: .5rem; }
.panel-head h2 { font-size: var(--step-2); }
.panel-head p { color: var(--sage); margin-top: .4rem; max-width: 64ch; }

/* Stat tiles */
.tiles { display: grid; gap: 1rem; grid-template-columns: repeat(2,1fr); margin-bottom: 1.6rem; }
@media (min-width: 760px) { .tiles { grid-template-columns: repeat(4,1fr); } }
.tile { background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.2rem; }
.tile b { display: block; font-family: var(--font-mono); font-size: var(--step-2); color: var(--ink); line-height: 1; }
.tile span { font-size: .8rem; color: var(--sage); }

/* Filter bar */
.filters { display: flex; flex-wrap: wrap; gap: .8rem; align-items: end; margin-bottom: 1.2rem; }
.filters .field { margin: 0; flex: 1 1 160px; }
.filters .field label { font-size: .78rem; margin-bottom: .3rem; }
.filters .field input, .filters .field select { padding: .6rem .7rem; border-radius: 9px; }
.filters .btn { flex: 0 0 auto; }

/* Data tables */
.table-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper-2); }
table.data { width: 100%; border-collapse: collapse; font-size: .9rem; min-width: 640px; }
table.data thead th {
  text-align: left; font-family: var(--font-mono); font-size: .72rem; letter-spacing: .05em;
  text-transform: uppercase; color: var(--sage); font-weight: 600;
  padding: .8rem .9rem; border-bottom: 1px solid var(--line); background: var(--mint-2);
  position: sticky; top: 0;
}
table.data tbody td { padding: .75rem .9rem; border-bottom: 1px solid var(--line); vertical-align: top; }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data tbody tr:hover { background: var(--mint-2); }
table.data .num { font-family: var(--font-mono); text-align: right; }
table.data .col-name b { font-weight: 600; }
table.data .col-name span { display: block; color: var(--sage); font-size: .78rem; }
.hl { background: rgba(216,162,74,.16); }

/* Type / band badges */
.badge-t { font-size: .68rem; font-family: var(--font-mono); padding: .2em .55em; border-radius: 6px; letter-spacing: .03em; }
.t-gov { background: rgba(30,122,94,.14); color: #14573f; }
.t-priv { background: rgba(216,162,74,.18); color: #8a5f12; }
.t-other { background: rgba(12,43,37,.08); color: var(--forest); }
.band { font-size: .68rem; font-family: var(--font-mono); padding: .2em .6em; border-radius: 999px; font-weight: 600; }
.band-safe { background: rgba(30,122,94,.16); color: #14573f; }
.band-likely { background: rgba(120,170,90,.18); color: #4f6b1f; }
.band-reach { background: rgba(216,162,74,.2); color: #8a5f12; }
.band-amb { background: rgba(239,106,77,.16); color: var(--coral-dk); }
.pos { color: #14573f; } .neg { color: var(--coral-dk); }

/* Fees / stipend / bond cards */
.fsb-grid { display: grid; gap: 1.2rem; }
@media (min-width: 880px) { .fsb-grid { grid-template-columns: 1.4fr 1fr; align-items: start; } }
.stack-cards { display: grid; gap: 1.2rem; }
.info-card { background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.4rem; }
.info-card h3 { font-size: var(--step-1); }
.info-card .src { font-size: .76rem; color: var(--sage); margin-top: 1rem; border-top: 1px dashed var(--line); padding-top: .8rem; }
.big-fig { font-family: var(--font-mono); font-size: var(--step-2); color: var(--ink); line-height: 1; }
.kv { display: flex; justify-content: space-between; gap: 1rem; padding: .55rem 0; border-bottom: 1px solid var(--line); }
.kv:last-child { border-bottom: 0; }
.kv .k { color: var(--forest); font-weight: 600; font-size: .9rem; }
.kv .v { font-family: var(--font-mono); font-size: .9rem; text-align: right; white-space: nowrap; }

/* loading / empty */
.muted-note { font-size: .82rem; color: var(--sage); margin-top: 1rem; }
.empty-row td { text-align: center; color: var(--sage); padding: 2rem; }
.loading { color: var(--sage); font-size: .9rem; padding: 1rem 0; }

/* small disclaimer banner reused from .notice in styles.css */
.panel .notice { margin-top: 1.4rem; }
