/* NEXORA — Client & Student Portal (sign in, sign up, dashboard) */

.portal {
  position: fixed;
  inset: 0;
  z-index: 85;
  background: radial-gradient(70% 55% at 50% 0%, #111119 0%, var(--bg) 62%);
  overflow-y: auto;
  overscroll-behavior: contain;
  animation: pageIn 0.6s var(--ease) both;
}
.portal__bar {
  position: sticky;
  top: 0;
  z-index: 3;
  padding-top: env(safe-area-inset-top, 0px);
  background: rgba(8, 8, 10, 0.82);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}
.portal__bar .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 68px;
}
.portal__shell {
  display: grid;
  justify-items: center;
  padding-block: clamp(36px, 7vw, 92px) clamp(48px, 8vw, 110px);
}
.portal__shell--wide { justify-items: stretch; }

/* ---------- Auth card ---------- */

.auth {
  --card-bg: #101015;
  width: min(100%, 460px);
  padding: clamp(26px, 4vw, 40px);
  border-radius: var(--r-l);
  box-shadow: 0 40px 120px -50px rgba(0, 0, 0, 0.95), var(--glow);
  display: grid;
  gap: 18px;
}
.auth .eyebrow { margin-bottom: 0; }
.auth__title {
  font-family: var(--f-display);
  font-weight: 400;
  font-size: clamp(1.9rem, 1.4rem + 1.8vw, 2.6rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
}
.auth__sub { color: var(--text-2); font-size: 0.9375rem; margin-top: -8px; text-wrap: pretty; }

.auth__tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line);
  background: rgba(8, 8, 10, 0.6);
}
.auth__tabs button {
  padding: 11px 12px;
  border-radius: var(--r-pill);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-3);
  transition: color 0.25s, background 0.35s var(--ease);
}
.auth__tabs button[aria-selected="true"] { color: var(--on-accent); background: var(--metal); }
.auth__tabs button[aria-selected="false"]:hover { color: var(--text); }

.auth form { display: grid; gap: 16px; }
.auth__go { width: 100%; margin-top: 2px; }
.auth__link {
  justify-self: center;
  font-size: 0.875rem;
  color: var(--text-2);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.auth__link:hover { color: var(--accent-hi); }
.auth__opt { color: var(--text-3); font-weight: 400; }
.auth__fine { font-size: 0.8125rem; color: var(--text-3); text-wrap: pretty; }

.auth__warn,
.auth__msg {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 13px 15px;
  border-radius: 12px;
  font-size: 0.875rem;
  line-height: 1.5;
  text-wrap: pretty;
}
.auth__warn {
  border: 1px solid rgba(216, 220, 226, 0.22);
  background: rgba(216, 220, 226, 0.06);
  color: var(--text-2);
}
.auth__warn svg { flex: none; width: 18px; height: 18px; color: var(--plat); margin-top: 1px; }
.auth__warn a { color: var(--accent-hi); text-decoration: underline; text-underline-offset: 3px; }
.auth__msg--error { border: 1px solid rgba(224, 106, 106, 0.4); background: rgba(224, 106, 106, 0.1); color: #f6b9b9; }
.auth__msg--ok { border: 1px solid rgba(90, 176, 96, 0.4); background: rgba(90, 176, 96, 0.1); color: #a8dcae; }

.roles {
  border: 0;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.roles legend {
  grid-column: 1 / -1;
  font-size: 0.8125rem;
  color: var(--text-2);
  font-weight: 500;
  padding: 0;
  margin-bottom: 8px;
}
.roles label {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 16px;
  border-radius: 12px;
  border: 1px solid var(--line-2);
  background: rgba(8, 8, 10, 0.7);
  font-size: 0.9375rem;
  cursor: pointer;
  transition: border-color 0.25s, background 0.25s;
}
.roles input { accent-color: var(--accent); width: 16px; height: 16px; }
.roles label:hover { background: rgba(74, 158, 255, 0.06); }
.roles label:has(input:checked) { border-color: var(--accent); background: rgba(74, 158, 255, 0.1); }

/* ---------- Dashboard ---------- */

.dash { width: 100%; display: grid; gap: clamp(28px, 4vw, 44px); }
.dash__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  padding-bottom: 26px;
  border-bottom: 1px solid var(--line);
}
.dash__hi {
  font-family: var(--f-display);
  font-weight: 400;
  font-size: clamp(2rem, 1.4rem + 2.4vw, 3.4rem);
  line-height: 1.02;
  letter-spacing: -0.02em;
}
.dash__hi em {
  font-style: italic;
  background: var(--metal);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.dash__who { margin-top: 8px; font-family: var(--f-mono); font-size: 0.8125rem; color: var(--text-3); }
.dash__loading { color: var(--text-2); font-family: var(--f-mono); font-size: 0.875rem; }
.dash__block { display: grid; gap: 18px; }
.dash__h {
  font-family: var(--f-wide);
  font-size: 0.625rem;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 400;
}

.dash__empty {
  --card-bg: var(--bg-2);
  padding: clamp(26px, 4vw, 40px);
  border-radius: var(--r-l);
  display: grid;
  gap: 14px;
  justify-items: start;
  max-width: 620px;
}
.dash__empty h3 { font-family: var(--f-display); font-weight: 500; font-size: 1.6rem; line-height: 1.1; }
.dash__empty p { color: var(--text-2); text-wrap: pretty; }
.dash__empty .btn { margin-top: 6px; }

.enrols {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 14px;
}
.enrol {
  --card-bg: var(--bg-2);
  padding: 26px;
  border-radius: var(--r-m);
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: transform 0.5s var(--ease), box-shadow 0.5s var(--ease);
}
.enrol:hover { transform: translateY(-4px); box-shadow: var(--glow); }
.enrol__top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.enrol__track {
  font-family: var(--f-wide);
  font-size: 0.5625rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--accent);
}
.enrol__name { font-family: var(--f-display); font-weight: 500; font-size: 1.35rem; line-height: 1.15; }
.enrol__facts { display: grid; gap: 10px; margin: 0; }
.enrol__facts div {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  font-size: 0.875rem;
  border-bottom: 1px dashed var(--line);
  padding-bottom: 9px;
}
.enrol__facts dt { color: var(--text-3); }
.enrol__facts dd { margin: 0; text-align: right; color: var(--text); }
.enrol .link-arrow { margin-top: auto; font-size: 0.875rem; }

.progress { display: grid; gap: 8px; }
.progress__bar { height: 4px; border-radius: 2px; background: rgba(216, 220, 226, 0.14); overflow: hidden; }
.progress__bar i { display: block; height: 100%; background: var(--metal); transition: width 0.8s var(--ease); }
.progress__num { font-family: var(--f-mono); font-size: 0.75rem; color: var(--text-3); }

.ann { padding: 18px 0; border-bottom: 1px solid var(--line); display: grid; gap: 6px; }
.ann:first-of-type { border-top: 1px solid var(--line); }
.ann__when { font-family: var(--f-mono); font-size: 0.75rem; color: var(--text-3); }
.ann h4 { font-weight: 600; }
.ann p { color: var(--text-2); font-size: 0.9375rem; text-wrap: pretty; }

/* ---------- Nav entry ---------- */

.nav__portal {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.875rem;
  color: var(--text-2);
  padding: 10px 16px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line-2);
  transition: color 0.25s, border-color 0.25s;
}
.nav__portal svg { width: 16px; height: 16px; }
.nav__portal:hover { color: var(--accent-hi); border-color: var(--accent); }

/* the header Login button keeps its label at every width, just gets tighter */
@media (max-width: 1080px) {
  .nav__portal { padding: 9px 14px; }
}
@media (max-width: 420px) {
  .nav__portal { padding: 8px 12px; gap: 6px; font-size: 0.8125rem; }
  .nav__portal svg { width: 15px; height: 15px; }
}
@media (max-width: 640px) {
  .roles { grid-template-columns: 1fr; }
  .enrols { grid-template-columns: 1fr; }
  .dash__head { align-items: flex-start; }
}

/* Quiet third button: sits beside the hero CTAs without competing with them */
.btn--line {
  color: var(--text-2);
  border: 1px solid var(--line-2);
  background: transparent;
}
.btn--line svg { width: 17px; height: 17px; }
.btn--line:hover { color: var(--accent-hi); border-color: var(--accent); }
.btn--line:hover svg { transform: none; }
