/* ════════════════════════════════════════════════════════════════
   AOU Portal — shared styles (uses tokens.css as base)
   ════════════════════════════════════════════════════════════════ */

* { box-sizing: border-box; }
*, *::before, *::after { margin: 0; padding: 0; }

html, body {
  background: var(--ink);
  color: #fff;
  font-family: var(--body);
  font-size: var(--t-body);
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; background: transparent; border: 0; color: inherit; }
img { max-width: 100%; display: block; }

::selection { background: var(--gold-bright); color: var(--ink); }
*:focus-visible { outline: 2px solid var(--gold-bright); outline-offset: 3px; border-radius: 4px; }

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* ─── Top bar ─── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(12, 4, 32, 0.85);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--gold-line);
  padding: 16px 0;
}
.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.topbar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.topbar-mark {
  width: 36px;
  height: 36px;
  border-radius: var(--r-md);
  background: linear-gradient(135deg, var(--gold-bright), var(--gold-deep));
  display: grid;
  place-items: center;
  color: var(--ink);
  font-family: var(--display);
  font-style: italic;
  font-size: 18px;
  font-weight: 600;
  box-shadow: 0 8px 24px -8px rgba(244, 200, 66, 0.5);
}
.topbar-title {
  font-family: var(--display);
  font-size: 18px;
  letter-spacing: -0.005em;
}
.topbar-nav {
  display: flex;
  align-items: center;
  gap: 28px;
}
.topbar-nav a {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.7);
  transition: color var(--d-fast) var(--ease-silk);
}
.topbar-nav a:hover,
.topbar-nav a.is-active { color: var(--gold-bright); }
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}
.dm-badge {
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: 1px solid var(--gold-line);
  transition: border-color var(--d-fast) var(--ease-silk);
}
.dm-badge:hover { border-color: var(--gold-bright); }
.dm-badge .count {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--burgundy-glow);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  padding: 0 5px;
  display: grid;
  place-items: center;
  letter-spacing: 0;
}
.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--ink-2);
  border: 1px solid var(--gold-line);
  display: grid;
  place-items: center;
  font-family: var(--display);
  font-size: 16px;
  color: var(--gold-bright);
  cursor: pointer;
}

/* ─── Buttons ─── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 22px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  border-radius: var(--r-pill);
  border: 1px solid transparent;
  transition: transform var(--d-ui) var(--ease-spring),
              background var(--d-fast) var(--ease-silk),
              border-color var(--d-fast) var(--ease-silk),
              color var(--d-fast) var(--ease-silk);
}
.btn:active { transform: scale(0.97); }
.btn-primary {
  background: linear-gradient(135deg, var(--gold-bright), var(--gold));
  color: var(--ink);
  font-weight: 600;
}
.btn-primary:hover { box-shadow: var(--glow-gold); }
.btn-ghost {
  background: transparent;
  color: rgba(255, 255, 255, 0.85);
  border-color: var(--gold-line);
}
.btn-ghost:hover { color: var(--gold-bright); border-color: var(--gold-bright); background: rgba(244, 200, 66, 0.06); }
.btn-lg { padding: 16px 32px; font-size: 13px; }

/* ─── Sign-in card ─── */
.signin-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 48px 16px;
  position: relative;
  overflow: hidden;
}
.signin-page::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(800px circle at 20% 10%, rgba(13, 107, 138, 0.25), transparent 60%),
    radial-gradient(700px circle at 80% 90%, rgba(192, 38, 211, 0.22), transparent 60%),
    radial-gradient(900px circle at 50% 50%, rgba(217, 119, 6, 0.18), transparent 70%);
  filter: blur(40px);
  z-index: 0;
}
.signin-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 460px;
  background: rgba(23, 9, 52, 0.7);
  border: 1px solid var(--gold-line);
  border-radius: var(--r-2xl);
  padding: 40px;
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  box-shadow: var(--sh-deep);
}
.signin-card h1 {
  font-family: var(--display);
  font-size: 36px;
  line-height: 1.1;
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}
.signin-card h1 em {
  color: var(--gold-bright);
  font-style: italic;
}
.signin-card .sub {
  color: rgba(255, 255, 255, 0.65);
  font-size: 15px;
  margin-bottom: 28px;
}
.signin-card label {
  display: block;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
  margin-bottom: 8px;
}
.signin-card input[type="email"],
.signin-card input[type="text"],
.signin-card input[type="password"] {
  width: 100%;
  padding: 16px 18px;
  font-family: var(--body);
  font-size: 17px;
  letter-spacing: 0;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--r-md);
  color: #fff;
  margin-bottom: 16px;
  transition: border-color var(--d-fast) var(--ease-silk),
              background var(--d-fast) var(--ease-silk),
              box-shadow var(--d-fast) var(--ease-silk);
  -webkit-appearance: none;
  appearance: none;
}
.signin-card input[type="password"] {
  font-family: var(--body);     /* keep monospace dots from kicking in */
  letter-spacing: 0.06em;
}
.signin-card input::placeholder { color: rgba(255, 255, 255, 0.35); }
.signin-card input:focus {
  outline: none;
  border-color: var(--gold-bright);
  background: rgba(255, 255, 255, 0.07);
  box-shadow: 0 0 0 3px rgba(244, 200, 66, 0.15);
}
/* Browser autofill background override — keep dark theme */
.signin-card input:-webkit-autofill,
.signin-card input:-webkit-autofill:focus {
  -webkit-text-fill-color: #fff;
  -webkit-box-shadow: 0 0 0 1000px rgba(23, 9, 52, 0.95) inset !important;
  box-shadow: 0 0 0 1000px rgba(23, 9, 52, 0.95) inset !important;
  caret-color: #fff;
  border-color: var(--gold-line);
}
.signin-card .btn { width: 100%; }
.signin-card .otp-step { display: none; }
.signin-card.show-otp .email-step { display: none; }
.signin-card.show-otp .otp-step { display: block; }
.signin-card .meta {
  margin-top: 24px;
  text-align: center;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.45);
}
.signin-card .meta a { color: var(--gold-bright); }
.signin-card .error {
  margin-top: 12px;
  padding: 12px 14px;
  background: rgba(185, 28, 60, 0.12);
  border: 1px solid rgba(185, 28, 60, 0.4);
  border-radius: var(--r-md);
  color: rgba(255, 200, 200, 0.95);
  font-size: 14px;
  display: none;
}
.signin-card .error.show { display: block; }
.signin-card .success {
  margin-top: 12px;
  padding: 12px 14px;
  background: rgba(45, 212, 162, 0.10);
  border: 1px solid rgba(45, 212, 162, 0.4);
  border-radius: var(--r-md);
  color: rgba(180, 255, 230, 0.95);
  font-size: 14px;
  display: none;
}
.signin-card .success.show { display: block; }

/* ─── Section heads ─── */
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin: 48px 0 20px;
}
.section-head h2 {
  font-family: var(--display);
  font-size: clamp(24px, 3vw, 32px);
  letter-spacing: -0.01em;
  font-weight: 400;
}
.section-head h2 em { color: var(--gold-bright); font-style: italic; }
.section-head .more {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
}

/* ─── Skeleton placeholders ─── */
.skel {
  background: linear-gradient(90deg, var(--ink-2), var(--ink-3), var(--ink-2));
  background-size: 200% 100%;
  animation: skel 1.4s ease-in-out infinite;
  border-radius: var(--r-md);
}
@keyframes skel {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ─── Toast ─── */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--ink-2);
  border: 1px solid var(--gold-line);
  border-radius: var(--r-pill);
  padding: 12px 22px;
  font-size: 14px;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--d-base) var(--ease-drama),
              transform var(--d-base) var(--ease-drama);
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

/* ─── Engagement: greeting strip + nudge banner ─── */
.greet-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 0 8px;
  flex-wrap: wrap;
}
.greet-text {
  font-family: var(--display);
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.05;
  letter-spacing: -0.01em;
  color: #fff;
  font-weight: 400;
}
.greet-text em { color: var(--gold-bright); font-style: italic; }
.greet-meta {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.6);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: rgba(244, 200, 66, 0.08);
  border: 1px solid var(--gold-line);
  border-radius: var(--r-pill);
}

.nudge-banner {
  background: rgba(45, 212, 162, 0.08);
  border: 1px solid rgba(45, 212, 162, 0.4);
  border-left: 3px solid var(--emerald-glow);
  border-radius: var(--r-md);
  padding: 14px 18px;
  margin: 16px 0 24px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  position: relative;
}
.nudge-banner .icon { font-size: 22px; flex-shrink: 0; }
.nudge-banner .body { flex: 1; }
.nudge-banner .body .from {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--emerald-glow);
  margin-bottom: 4px;
}
.nudge-banner .body p { font-size: 15px; line-height: 1.5; color: rgba(255, 255, 255, 0.92); }
.nudge-banner .dismiss {
  position: absolute;
  top: 8px;
  right: 12px;
  color: rgba(255, 255, 255, 0.4);
  font-size: 18px;
  cursor: pointer;
  background: transparent;
  border: 0;
}
.nudge-banner .dismiss:hover { color: #fff; }

/* ─── Term of the Day card ─── */
.tod-card {
  background: linear-gradient(135deg, rgba(23, 9, 52, 0.85) 0%, rgba(32, 16, 74, 0.85) 100%);
  border: 1px solid var(--gold-line);
  border-radius: 18px;
  padding: 32px;
  margin: 24px 0;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(20px);
}
.tod-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--gold-bright), var(--gold-deep));
}
.tod-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(800px circle at top right, rgba(244, 200, 66, 0.06), transparent 60%);
  pointer-events: none;
}
.tod-eyebrow {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold-bright);
  margin-bottom: 12px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.tod-term {
  font-family: var(--display);
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.1;
  letter-spacing: -0.01em;
  color: #fff;
  margin-bottom: 14px;
  font-weight: 400;
}
.tod-definition {
  font-size: 17px;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: 16px;
  max-width: 720px;
}
.tod-example {
  background: rgba(255, 255, 255, 0.04);
  border-left: 2px solid var(--gold-bright);
  padding: 12px 16px;
  font-size: 14px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.75);
  border-radius: 0 var(--r-md) var(--r-md) 0;
  margin-bottom: 12px;
}
.tod-week {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(244, 200, 66, 0.7);
}

/* ─── Fun fact strip ─── */
.fact-strip {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(244, 200, 66, 0.10);
  border-radius: var(--r-md);
  margin: 8px 0 24px;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.5;
}
.fact-strip .fact-icon {
  font-size: 18px;
  flex-shrink: 0;
}
.fact-strip .fact-label {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold-bright);
  flex-shrink: 0;
}

/* ─── Cohort countdown / day strip (12-week heat strip) ─── */
.day-strip {
  display: flex;
  gap: 3px;
  flex-wrap: wrap;
  padding: 18px;
  background: rgba(23, 9, 52, 0.6);
  border: 1px solid var(--gold-line);
  border-radius: var(--r-md);
  margin: 16px 0 24px;
}
.day-cell {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.05);
  transition: all var(--d-fast) var(--ease-silk);
  cursor: default;
}
.day-cell.watched {
  background: var(--gold-bright);
  box-shadow: 0 0 6px rgba(244, 200, 66, 0.5);
}
.day-cell.partial { background: rgba(244, 200, 66, 0.3); }
.day-cell.future  { background: rgba(255, 255, 255, 0.03); border: 1px dashed rgba(244, 200, 66, 0.15); }
.day-cell.today {
  outline: 2px solid var(--gold-bright);
  outline-offset: 2px;
}
.day-cell:hover { transform: scale(1.4); z-index: 1; position: relative; }

/* ─── Topbar XP/level pill ─── */
.xp-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: rgba(244, 200, 66, 0.12);
  border: 1px solid var(--gold-line);
  border-radius: var(--r-pill);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold-bright);
  white-space: nowrap;
}
.xp-pill .level-name { color: #fff; font-weight: 500; }
.xp-pill .xp-num { color: var(--gold-bright); font-weight: 600; }
.xp-pill .xp-progress {
  width: 36px;
  height: 4px;
  background: rgba(244, 200, 66, 0.2);
  border-radius: 2px;
  overflow: hidden;
  margin-left: 4px;
}
.xp-pill .xp-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold-bright), var(--gold-deep));
  transition: width var(--d-slow) var(--ease-drama);
}
