/* Shared Open Sky Academy look — first entry + auth pages
   Aligns with Academy hub (index.html): Fraunces/Inter, navy/gold/cream, UH red accent. */

:root {
  --navy-bg: #0d1b2a;
  --navy-mark: #17345c;
  --gold-1: #b0801f;
  --gold-2: #d2a136;
  --gold-3: #e8c463;
  --cream: #f4f1ea;
  --subline: #9fb0c0;
  --uh-red: #c8102e;
  --ink: #1c2b3a;
  --muted: #56657a;
  --paper: #fdfcf9;
  --radius: 14px;
  --shadow: 0 10px 40px rgba(13, 27, 42, 0.1);
  --shadow-lg: 0 24px 70px rgba(13, 27, 42, 0.18);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { height: 100%; }
body {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 {
  font-family: "Fraunces", Georgia, serif;
  font-weight: 500;
  line-height: 1.2;
  color: var(--navy-mark);
}
a { color: var(--navy-mark); font-weight: 600; }
img { max-width: 100%; display: block; }

/* ---------- Top nav (matches Academy hub) ---------- */
.auth-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(253, 252, 249, 0.94);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(23, 52, 92, 0.1);
  flex-shrink: 0;
}
.auth-nav-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 28px;
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.auth-nav-brand img {
  height: 40px;
  width: auto;
  min-width: 120px;
  display: block;
}
.auth-nav-meta {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: right;
}
.auth-nav-meta strong {
  display: block;
  color: var(--navy-mark);
  letter-spacing: 0.02em;
  text-transform: none;
  font-size: 0.9rem;
  font-weight: 600;
  margin-top: 2px;
}
.auth-nav-links {
  display: flex;
  align-items: center;
  gap: 20px;
  list-style: none;
}
.auth-nav-links a {
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--navy-mark);
  opacity: 0.8;
}
.auth-nav-links a:hover { opacity: 1; }
.auth-nav-links .nav-cta {
  background: var(--navy-mark);
  color: #fff !important;
  opacity: 1 !important;
  padding: 10px 20px;
  border-radius: 999px;
  font-size: 0.84rem;
}
.auth-nav-links .nav-cta:hover { background: var(--navy-bg); }

/* ---------- Page shell ---------- */
.auth-page {
  position: relative;
  overflow: hidden;
  flex: 1;
  background: linear-gradient(180deg, #eef2f0 0%, var(--paper) 62%);
}
.auth-page::before {
  content: "";
  position: absolute;
  top: -200px;
  right: -160px;
  width: 520px;
  height: 520px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(159, 176, 192, 0.28), transparent 65%);
  pointer-events: none;
}
.auth-wrap {
  position: relative;
  max-width: 1180px;
  margin: 0 auto;
  padding: 48px 28px 72px;
  display: grid;
  gap: 28px;
}
.auth-wrap.centered {
  min-height: calc(100vh - 76px - 180px);
  align-content: center;
  justify-items: center;
}

/* Split first-entry: brand story + form.
   Both columns start at the top. Centring only reads well when the two are
   similar heights, and the form card is far taller than the brand panel — it
   carries the returning-user form, the whole first-time setup, and the
   magic-link option. Centring pushed the brand panel down by nearly 300px,
   leaving a void beside the card and running its last lines off-screen. */
.auth-wrap.split {
  min-height: calc(100vh - 76px - 180px);
  grid-template-columns: 1.05fr 0.95fr;
  gap: 48px 64px;
  align-items: start;
  padding-top: 56px;
  padding-bottom: 80px;
}
/* Belt and braces: the panel stays put however tall the card grows. */
.auth-wrap.split > .auth-brand-panel { align-self: start; }
@media (max-width: 900px) {
  .auth-wrap.split {
    grid-template-columns: 1fr;
    gap: 36px;
    min-height: 0;
    padding-top: 36px;
  }
  .auth-brand-panel { order: -1; text-align: center; }
  .auth-brand-panel .lede { margin-left: auto; margin-right: auto; }
  .auth-brand-panel .hero-lockup img { margin-left: auto; margin-right: auto; }
  .auth-brand-panel .eyebrow { justify-content: center; }
  .auth-brand-panel .trust-row { justify-content: center; }
}

.auth-brand-panel { position: relative; z-index: 1; }
.auth-brand-panel .hero-lockup {
  margin-bottom: 28px;
}
.auth-brand-panel .hero-lockup img {
  width: 260px;
  min-width: 160px;
  height: auto;
}
.logo-static { display: none; }
@media (prefers-reduced-motion: reduce) {
  .logo-animated { display: none; }
  .logo-static { display: block; }
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--navy-mark);
  background: #fff;
  border: 1px solid rgba(23, 52, 92, 0.14);
  border-radius: 999px;
  padding: 8px 16px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}
.eyebrow .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--uh-red);
}

.auth-brand-panel h1 {
  font-size: clamp(1.85rem, 3.6vw, 2.65rem);
  letter-spacing: -0.01em;
  margin: 18px 0 16px;
}
.auth-brand-panel h1 em {
  font-style: italic;
  background: linear-gradient(100deg, var(--gold-1), var(--gold-2) 55%, var(--gold-3));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.auth-brand-panel .lede {
  font-size: 1.05rem;
  color: var(--muted);
  max-width: 34em;
  margin-bottom: 28px;
}

.trust-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 22px;
}
.uh-logo-chip {
  display: inline-block;
  background: #fff;
  border-radius: 10px;
  padding: 12px 16px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(23, 52, 92, 0.08);
}
.uh-logo-chip img {
  height: 36px;
  width: auto;
}
.trust-note {
  font-size: 0.82rem;
  color: var(--muted);
  max-width: 18em;
  line-height: 1.45;
}
.trust-note strong {
  display: block;
  color: var(--navy-mark);
  font-size: 0.88rem;
  margin-bottom: 2px;
}

/* Figure / photo accent (optional on first entry) */
.auth-figure {
  margin-top: 32px;
  position: relative;
  max-width: 420px;
}
.auth-figure img {
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  aspect-ratio: 4 / 3;
  object-fit: cover;
  width: 100%;
}
.auth-figure .hero-card {
  position: absolute;
  left: -12px;
  bottom: -18px;
  background: #fff;
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 280px;
}
.auth-figure .hero-card .bar {
  width: 4px;
  align-self: stretch;
  border-radius: 4px;
  background: linear-gradient(180deg, var(--gold-1), var(--gold-3));
}
.auth-figure .hero-card p {
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.4;
}
.auth-figure .hero-card strong {
  color: var(--navy-mark);
  display: block;
  font-size: 0.84rem;
}
@media (max-width: 900px) {
  .auth-figure { display: none; }
}

/* ---------- Cards / forms ---------- */
.auth-card {
  width: min(440px, 100%);
  background: #fff;
  border: 1px solid rgba(23, 52, 92, 0.1);
  border-radius: var(--radius);
  padding: 32px 28px 28px;
  box-shadow: var(--shadow-lg);
  position: relative;
  z-index: 1;
}
.auth-wrap.split .auth-card {
  width: 100%;
  max-width: 440px;
  justify-self: end;
}
@media (max-width: 900px) {
  .auth-wrap.split .auth-card { justify-self: center; }
}
.auth-card h1 {
  font-size: clamp(1.55rem, 3vw, 1.9rem);
  margin: 0 0 10px;
}
.auth-card h1 em {
  font-style: italic;
  background: linear-gradient(100deg, var(--gold-1), var(--gold-2) 55%, var(--gold-3));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.auth-card .lede {
  font-size: 1rem;
  color: var(--muted);
  margin: 0 0 22px;
  max-width: 34em;
}

label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}
input[type="email"],
input[type="text"],
input[type="password"],
textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid rgba(23, 52, 92, 0.18);
  border-radius: 10px;
  font: inherit;
  font-size: 1rem;
  color: var(--ink);
  background: #fff;
  margin-bottom: 14px;
}
input:focus, textarea:focus {
  outline: none;
  border-color: var(--gold-2);
  box-shadow: 0 0 0 3px rgba(210, 161, 54, 0.22);
}

.btn {
  display: inline-block;
  border: 0;
  border-radius: 999px;
  padding: 14px 26px;
  font: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  transition: transform 0.15s, box-shadow 0.15s, background 0.2s;
}
.btn:hover { transform: translateY(-1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn-primary {
  width: 100%;
  background: var(--navy-mark);
  color: #fff;
  box-shadow: 0 8px 24px rgba(23, 52, 92, 0.28);
}
.btn-primary:hover:not(:disabled) { background: var(--navy-bg); }
.btn-ghost {
  background: rgba(255, 255, 255, 0.7);
  color: var(--navy-mark);
  border: 1.5px solid rgba(23, 52, 92, 0.22);
}
.btn-secondary {
  width: 100%;
  background: #fff;
  color: var(--navy-mark);
  border: 1.5px solid rgba(23, 52, 92, 0.22);
  box-shadow: none;
}
.btn-secondary:hover:not(:disabled) {
  background: var(--cream);
  border-color: var(--navy-mark);
}
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0 14px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(23, 52, 92, 0.14);
}
.auth-link-row {
  display: flex;
  justify-content: flex-end;
  margin: -6px 0 14px;
  font-size: 0.86rem;
}
.auth-link-row a {
  font-weight: 600;
  text-decoration: none;
}
.auth-link-row a:hover { text-decoration: underline; }
.auth-hint {
  font-size: 0.82rem;
  color: var(--muted);
  margin: -6px 0 14px;
  line-height: 1.4;
}
.auth-hint.code-prefilled {
  color: var(--navy-mark);
  font-weight: 600;
  border-left: 3px solid var(--navy-mark);
  padding-left: 10px;
}

.msg {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 0.92rem;
  line-height: 1.45;
  display: none;
}
.msg.show { display: block; }
.msg.ok { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.msg.err { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }

.foot {
  margin-top: 20px;
  font-size: 0.86rem;
  color: var(--muted);
  line-height: 1.5;
}
.foot a { font-weight: 600; }

.auth-aside {
  max-width: 34em;
  color: var(--muted);
  font-size: 0.95rem;
}
.auth-aside strong { color: var(--navy-mark); }

/* My courses — hub-style pathway cards */
.auth-wrap.courses-page {
  max-width: 900px;
  padding-top: 40px;
  padding-bottom: 64px;
}
.page-head {
  width: 100%;
  margin-bottom: 8px;
}
.page-head .hero-lockup {
  margin-bottom: 22px;
}
.page-head .hero-lockup img {
  width: 180px;
  height: auto;
}
.page-head h1 {
  font-size: clamp(1.9rem, 3.4vw, 2.5rem);
  margin: 14px 0 10px;
  letter-spacing: -0.01em;
}
.page-head h1 em {
  font-style: italic;
  background: linear-gradient(100deg, var(--gold-1), var(--gold-2) 55%, var(--gold-3));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.page-head .meta { color: var(--muted); font-size: 0.98rem; max-width: 40em; }
.page-head .who-line {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--navy-mark);
  background: #fff;
  border: 1px solid rgba(23, 52, 92, 0.12);
  border-radius: 999px;
  padding: 8px 14px;
  box-shadow: var(--shadow);
}
.page-head .who-line::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #16a34a;
  flex-shrink: 0;
}
.page-actions { display: flex; flex-wrap: wrap; gap: 12px 16px; margin-top: 18px; }
.page-actions .btn { width: auto; padding: 11px 20px; font-size: 0.9rem; }

.course-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  width: 100%;
  margin-top: 28px;
}
@media (min-width: 720px) {
  .course-list.multi { grid-template-columns: 1fr 1fr; }
}
.course-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: #fff;
  border: 1px solid rgba(23, 52, 92, 0.08);
  border-top: 5px solid var(--navy-mark);
  border-radius: var(--radius);
  padding: 28px 26px;
  box-shadow: var(--shadow);
  transition: transform 0.2s, box-shadow 0.2s;
}
.course-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}
.course-card .term {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--uh-red);
}
.course-card .code {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--navy-mark);
  letter-spacing: 0.06em;
}
.course-card strong {
  display: block;
  font-family: "Fraunces", Georgia, serif;
  font-weight: 500;
  font-size: 1.35rem;
  color: var(--navy-mark);
  line-height: 1.2;
}
.course-card .blurb {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.5;
  flex: 1;
}
.course-card .meta-row {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.course-card .btn {
  width: auto;
  align-self: flex-start;
  padding: 12px 22px;
  font-size: 0.9rem;
  margin-top: 4px;
}
.course-empty {
  width: 100%;
  background: #fff;
  border: 1px solid rgba(23, 52, 92, 0.1);
  border-radius: var(--radius);
  padding: 32px 28px;
  box-shadow: var(--shadow);
  margin-top: 28px;
}
.course-empty h2 {
  font-size: 1.35rem;
  margin-bottom: 10px;
}
.course-empty p {
  color: var(--muted);
  font-size: 0.98rem;
  max-width: 36em;
  margin-bottom: 18px;
}

/* ---------- Site footer (navy, matches hub) ---------- */
.auth-site-footer {
  flex-shrink: 0;
  background: var(--navy-bg);
  color: var(--subline);
}
.auth-site-footer-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 36px 28px 22px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 32px;
  align-items: center;
}
.auth-site-footer-inner img {
  width: 160px;
  height: auto;
}
.auth-site-footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: center;
  list-style: none;
}
.auth-site-footer-links a {
  text-decoration: none;
  font-size: 0.86rem;
  color: var(--subline);
  font-weight: 500;
}
.auth-site-footer-links a:hover { color: var(--cream); }
.auth-site-footer-note {
  font-size: 0.8rem;
  text-align: right;
  color: var(--subline);
}
.auth-site-footer-note .rule {
  width: 40px;
  height: 3px;
  background: var(--uh-red);
  border-radius: 2px;
  margin: 0 0 10px auto;
}
.auth-site-footer-base {
  border-top: 1px solid rgba(244, 241, 234, 0.1);
  max-width: 1180px;
  margin: 0 auto;
  padding: 16px 28px 24px;
  font-size: 0.78rem;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}
@media (max-width: 880px) {
  .auth-site-footer-inner {
    grid-template-columns: 1fr;
    text-align: center;
    justify-items: center;
  }
  .auth-site-footer-note { text-align: center; }
  .auth-site-footer-note .rule { margin: 0 auto 10px; }
  .auth-nav-meta { display: none; }
  .auth-wrap { padding: 32px 16px 56px; }
  .auth-card { padding: 26px 20px 22px; }
}

/* Saving a profile used to whisper. Now it says so, and offers the result. */
.saved-banner {
  margin: 0 0 16px; padding: 14px 16px;
  border: 1px solid #b7e0c4; border-left: 5px solid #176246; border-radius: 10px;
  background: #eef9f1; color: #15452f; font-size: 15px; line-height: 1.5;
}
.saved-banner strong { color: #0f3a26; }
.saved-banner a { margin-left: 8px; color: #0f5132; font-weight: 800; text-decoration: underline; }
.btn.is-saved { background: #176246 !important; border-color: #176246 !important; color: #fff !important; }

/* Sign-in help: the UH dual-address problem, answered before it bites. */
.signin-help-block { margin-top: 10px; padding: 11px 14px; border-radius: 8px;
  background: rgba(232, 163, 23, .10); border-left: 3px solid #e8a317;
  font-size: 14px; line-height: 1.55; }
.signin-help-block a { font-weight: 700; }

/* My Courses: something to look at while memberships sync. */
.course-loading { display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 20px 22px; border: 1px dashed rgba(13, 54, 114, .28); border-radius: 12px;
  color: #5a6a7a; font-size: 15px; }
.course-spinner { width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid rgba(13, 54, 114, .22); border-top-color: #0d3672;
  animation: course-spin .7s linear infinite; flex: none; }
@keyframes course-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .course-spinner { animation: none; } }

/* Small inline edit control inside a table cell. */
.linkish { border: 0; background: none; padding: 0 0 0 6px; cursor: pointer;
  color: #0d3672; font-size: 12px; font-weight: 600; text-decoration: underline; }
.linkish:hover { color: #b0801f; }

/* Profile: a way back to the class you came from. */
.profile-backlinks { margin: 0 0 12px; font-size: 14px; font-weight: 600; }
.profile-backlinks a { color: #0d3672; text-decoration: none; }
.profile-backlinks a:hover { text-decoration: underline; }
.profile-backlinks span { color: #9aa7b5; margin: 0 2px; }
