/* ============================================================
   Next Frontier Builders — design system
   Warm cream + terracotta palette derived from AI for Real Life
   (Moms edition). Designed for the buyer — calm, grown-up, warm.
   Typography: Instrument Serif (display) + Outfit (body) — the
   family typeface system used by three of the four NFB courses.
   ============================================================ */

:root {
  /* Surfaces */
  --bg-primary:    #fdfaf5;
  --bg-secondary:  #f7f1e6;
  --bg-tertiary:   #f0e8d8;
  --surface:       #ffffff;
  --surface-warm:  #fbf6ec;
  --surface-deep:  #f5efe3;

  /* Accents — terracotta + warm gold */
  --accent:         #c47a5c;
  --accent-light:   #d89477;
  --accent-bright:  #b46648;
  --accent-dim:     #e0a78e;
  --accent-soft:    rgba(196, 122, 92, 0.10);
  --gold:           #d4a866;
  --sage:           #8a9d7f;

  /* Text */
  --text:       #2a2622;
  --text-muted: #5c554d;
  --text-dim:   #9a9086;

  /* Borders */
  --border:        rgba(196, 122, 92, 0.18);
  --border-bright: rgba(196, 122, 92, 0.35);
  --border-soft:   #e8dfcf;
  --border-line:   rgba(196, 122, 92, 0.12);

  /* Typography */
  --font-display: 'Instrument Serif', Georgia, 'Times New Roman', serif;
  --font-body:    'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  /* Type scale */
  --fs-display-xl: clamp(40px, 6vw, 56px);
  --fs-display-l:  clamp(28px, 4vw, 36px);
  --fs-display-m:  clamp(22px, 2.6vw, 26px);
  --fs-body-l:     clamp(17px, 1.4vw, 19px);
  --fs-body-m:     17px;
  --fs-body-s:     14px;
  --fs-tiny:       11px;

  --lh-tight: 1.06;
  --lh-head:  1.15;
  --lh-body:  1.6;

  /* Spacing — 8-based */
  --s-1: 4px;  --s-2: 8px;  --s-3: 12px; --s-4: 16px;
  --s-5: 24px; --s-6: 32px; --s-7: 48px; --s-8: 64px;
  --s-9: 96px;

  /* Layout */
  --container:      1100px;
  --container-mid:  900px;
  --container-text: 680px;
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-pill: 999px;

  /* Motion */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --transition: all 0.3s var(--ease);

  /* Soft warm shadows */
  --shadow-sm: 0 1px 3px rgba(90, 60, 40, 0.08);
  --shadow-md: 0 6px 18px rgba(90, 60, 40, 0.10);
  --shadow-lg: 0 14px 36px rgba(90, 60, 40, 0.14);
}

/* ---- Reset-ish ------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  margin: 0;
  background: var(--bg-primary);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--fs-body-m);
  line-height: var(--lh-body);
  letter-spacing: 0.1px;
}

img, svg { display: block; max-width: 100%; height: auto; }

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 120ms var(--ease);
}
a:hover { color: var(--accent-bright); }

button { font: inherit; cursor: pointer; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: -0.01em;
  margin: 0 0 var(--s-4);
  color: var(--text);
  line-height: var(--lh-head);
}
h1 { font-size: var(--fs-display-xl); line-height: var(--lh-tight); }
h2 { font-size: var(--fs-display-l); }
h3 { font-size: var(--fs-display-m); }

p { margin: 0 0 var(--s-4); max-width: 68ch; }
ul, ol { margin: 0 0 var(--s-4); padding-left: 1.2em; }
li + li { margin-top: var(--s-2); }
strong { font-weight: 600; color: var(--text); }
em { font-style: italic; color: var(--accent); }

a:focus-visible, button:focus-visible, input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* ---- Skip link ------------------------------------------ */
.skip-link {
  position: absolute; top: -40px; left: 0;
  background: var(--text); color: var(--bg-primary);
  padding: var(--s-3) var(--s-4);
  z-index: 1000; text-decoration: none;
}
.skip-link:focus { top: 0; }

/* ---- Layout --------------------------------------------- */
.container {
  width: 100%; max-width: var(--container);
  margin: 0 auto; padding: 0 var(--s-5);
}
@media (min-width: 720px) { .container { padding: 0 var(--s-6); } }
.container--mid  { max-width: var(--container-mid); }
.container--text { max-width: var(--container-text); }

.text-muted { color: var(--text-muted); }
.text-dim   { color: var(--text-dim); }
.text-small { font-size: var(--fs-body-s); }

.eyebrow {
  font-family: var(--font-body);
  font-size: var(--fs-tiny);
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent-bright);
}

/* ---- Wordmark ------------------------------------------- */
.wordmark {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 18px;
  letter-spacing: -0.01em;
  color: var(--text);
  text-decoration: none;
  display: inline-flex;
  align-items: baseline;
  white-space: nowrap;
}
.wordmark:hover { color: var(--text); }
.wordmark__serif {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: 1.12em;
  color: var(--accent);
  margin: 0 0.15em;
}

/* ---- Site header / nav ---------------------------------- */
.site-header {
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border-line);
  position: sticky; top: 0; z-index: 50;
}
.nav {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--s-4);
  padding: var(--s-4) 0;
}
.nav__links {
  display: flex; align-items: center; gap: var(--s-5);
  list-style: none; margin: 0; padding: 0;
}
.nav__links li + li { margin-top: 0; }
.nav__links a {
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
}
.nav__links a:hover { color: var(--accent); }
.auth-state__link {
  color: var(--accent);
  font-size: 14px;
  font-weight: 500;
}
.auth-state__link:hover { color: var(--accent-bright); }
.auth-state__sep { color: var(--text-dim); margin: 0 var(--s-1); }
.auth-state__signout {
  background: none;
  border: none;
  padding: 0;
  font-size: 14px;
  font-weight: 500;
  color: var(--accent);
  font-family: var(--font-body);
  cursor: pointer;
}
.auth-state__signout:hover {
  color: var(--accent-bright);
}

@media (max-width: 600px) {
  .nav__links { gap: var(--s-3); flex-wrap: wrap; }
}

/* ---- Buttons -------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: var(--s-2);
  padding: 13px 26px;
  font-family: var(--font-body);
  font-weight: 600; font-size: 15px;
  line-height: 1;
  border-radius: var(--radius-pill);
  border: 1.5px solid transparent;
  text-decoration: none; cursor: pointer;
  transition: all 140ms var(--ease);
  white-space: nowrap;
}
.btn:hover  { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn--primary {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}
.btn--primary:hover {
  background: var(--accent-bright);
  border-color: var(--accent-bright);
  color: white;
  box-shadow: var(--shadow-md);
}
.btn--secondary,
.btn--ghost {
  background: transparent;
  color: var(--accent);
  border-color: var(--border-bright);
}
.btn--secondary:hover,
.btn--ghost:hover {
  background: var(--surface-warm);
  border-color: var(--accent);
  color: var(--accent-bright);
}
.btn--large { padding: 16px 32px; font-size: 16px; }
.btn--small { padding: 10px 18px; font-size: 13px; }
.btn--block { width: 100%; }

.link-arrow {
  display: inline-flex; align-items: center; gap: 4px;
  color: var(--accent); font-weight: 500;
  text-decoration: none;
}
.link-arrow:hover { color: var(--accent-bright); }
.link-arrow::after { content: " →"; transition: transform 140ms var(--ease); }
.link-arrow:hover::after { transform: translateX(3px); }

/* ---- Hero ----------------------------------------------- */
.hero {
  padding: var(--s-9) 0 var(--s-8);
  background: var(--bg-primary);
  text-align: center;
}
.hero__headline {
  max-width: 18ch;
  margin: 0 auto var(--s-5);
  font-size: var(--fs-display-xl);
  line-height: var(--lh-tight);
}
.hero__sub {
  max-width: 56ch;
  margin: 0 auto var(--s-6);
  font-size: var(--fs-body-l);
  color: var(--text-muted);
  line-height: 1.55;
}
.hero__ctas {
  display: flex; flex-wrap: wrap; gap: var(--s-3);
  justify-content: center;
}

/* ---- Sections ------------------------------------------- */
.section {
  padding: var(--s-8) 0 var(--s-9);
}
.section--cream {
  background: var(--surface-warm);
  border-top: 1px solid var(--border-line);
}
.section__eyebrow {
  display: block;
  margin: 0 auto var(--s-3);
  text-align: center;
}
.section__head {
  max-width: 22ch;
  margin: 0 auto var(--s-7);
  text-align: center;
  font-size: var(--fs-display-l);
}

/* ---- Course tiles (landing page) ------------------------ */
.courses-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s-4);
  list-style: none;
  margin: 0;
  padding: 0;
  max-width: 880px;
  margin-left: auto;
  margin-right: auto;
}
@media (min-width: 720px) {
  .courses-grid { grid-template-columns: 1fr 1fr; }
}
.courses-grid li + li { margin-top: 0; }

.course-tile {
  display: flex; flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--s-5);
  transition: border-color 140ms var(--ease), transform 140ms var(--ease), box-shadow 140ms var(--ease);
  text-decoration: none;
  color: inherit;
}
.course-tile:hover {
  border-color: var(--border-bright);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  color: inherit;
}
.course-tile__audience {
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: var(--s-2);
}
.course-tile__title {
  font-size: 22px;
  margin: 0 0 var(--s-2);
}
.course-tile__price {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: var(--s-3);
}
.course-tile__desc {
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-muted);
  margin-bottom: var(--s-4);
  flex: 1;
}
.course-tile__cta {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.course-tile__cta-sep {
  color: var(--text-dim);
  font-size: 14px;
  user-select: none;
}
.link-arrow--muted {
  color: var(--text-muted);
}
.link-arrow--muted:hover {
  color: var(--accent);
}

/* ---- Auth pages (login / signup) ------------------------ */
.auth-page {
  padding: var(--s-9) 0;
  min-height: calc(100vh - 200px);
}
.auth-card {
  max-width: 460px;
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--s-7);
  box-shadow: var(--shadow-sm);
}
.auth-card__title {
  font-size: 32px;
  margin-bottom: var(--s-2);
}
.auth-card__intro {
  color: var(--text-muted);
  font-size: var(--fs-body-m);
  margin-bottom: var(--s-6);
}
.form-row { margin-bottom: var(--s-4); }
.form-row label {
  display: block;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 13px;
  margin-bottom: var(--s-2);
  color: var(--text-muted);
  letter-spacing: 0.02em;
}
.form-row input {
  width: 100%;
  padding: 12px 14px;
  font-family: var(--font-body);
  font-size: 16px;
  background: var(--bg-primary);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: border-color 120ms var(--ease), box-shadow 120ms var(--ease);
}
.form-row input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.form-divider {
  display: flex; align-items: center;
  gap: var(--s-3);
  margin: var(--s-6) 0;
  color: var(--text-dim);
  font-family: var(--font-body);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-weight: 600;
}
.form-divider::before, .form-divider::after {
  content: "";
  flex: 1;
  border-top: 1px solid var(--border);
}
.form-message {
  padding: var(--s-3) var(--s-4);
  border-radius: var(--radius-md);
  font-size: 14px;
  margin-bottom: var(--s-4);
  font-family: var(--font-body);
}
.form-message--error {
  background: rgba(217, 144, 136, 0.10);
  color: #a04a40;
  border: 1px solid rgba(217, 144, 136, 0.32);
}
.form-message--success {
  background: rgba(155, 179, 154, 0.10);
  color: #4d6b4c;
  border: 1px solid rgba(155, 179, 154, 0.32);
}
.auth-card__footer {
  text-align: center;
  margin-top: var(--s-6);
  padding-top: var(--s-5);
  border-top: 1px solid var(--border);
  font-size: var(--fs-body-s);
  color: var(--text-muted);
}
.auth-card__footer a { color: var(--accent); font-weight: 500; }
.auth-card__footer a:hover { color: var(--accent-bright); }

/* ---- Dashboard ------------------------------------------ */
.dashboard {
  padding: var(--s-8) 0 var(--s-9);
}
.dashboard__greeting {
  font-size: var(--fs-display-l);
  margin-bottom: var(--s-3);
}
.dashboard__intro {
  color: var(--text-muted);
  font-size: var(--fs-body-l);
  margin-bottom: var(--s-7);
  max-width: 56ch;
}

#course-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--s-4);
}
.course-card {
  display: flex; flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--s-5);
}
.course-card__header { margin-bottom: var(--s-4); }
.course-card__audience {
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-dim);
  display: block;
  margin-bottom: var(--s-2);
}
.course-card__title {
  font-size: 22px;
  margin-bottom: var(--s-2);
}
.course-card__tagline {
  font-family: var(--font-body);
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.55;
  margin: 0;
}
.course-card__progress {
  margin-bottom: var(--s-5);
  flex: 1;
}
.course-card__progress-meta {
  margin: var(--s-3) 0 0;
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--text-muted);
}
.course-card__progress-meta strong {
  color: var(--text);
  font-weight: 600;
}
.course-card__price {
  margin-bottom: var(--s-5);
  flex: 1;
  display: flex; flex-direction: column; gap: var(--s-1);
}
.course-card__price-amount {
  font-family: var(--font-display);
  font-size: 30px;
  color: var(--text);
  letter-spacing: -0.01em;
  line-height: 1;
}
.course-card__price-detail {
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--text-dim);
}
.course-card__footer { margin-top: auto; }

.progress-bar {
  width: 100%; height: 8px;
  background: var(--accent-soft);
  border-radius: var(--radius-pill);
  overflow: hidden;
}
.progress-bar__fill {
  height: 100%;
  background: var(--accent);
  transition: width 240ms var(--ease);
}

#dashboard-empty-state {
  margin-top: var(--s-7);
  padding: var(--s-6);
  background: var(--surface-warm);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  color: var(--text-muted);
}
#dashboard-empty-state h3 { margin-bottom: var(--s-3); }

/* ---- Footer --------------------------------------------- */
.site-footer {
  background: var(--surface-deep);
  padding: var(--s-8) 0 var(--s-7);
  margin-top: var(--s-9);
  border-top: 1px solid var(--border-line);
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: var(--s-7);
  margin-bottom: var(--s-7);
}
@media (max-width: 720px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: var(--s-5); }
}
.footer__brand p {
  margin-top: var(--s-3);
  color: var(--text-muted);
  font-size: 14px;
  max-width: 36ch;
}
.footer__col h4 {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--text-dim);
  margin-bottom: var(--s-3);
}
.footer__col ul { list-style: none; margin: 0; padding: 0; }
.footer__col li + li { margin-top: var(--s-2); }
.footer__col a {
  color: var(--text-muted);
  font-size: 14px;
}
.footer__col a:hover { color: var(--accent); }
.footer__bar {
  border-top: 1px solid var(--border);
  padding-top: var(--s-5);
  font-size: 13px;
  color: var(--text-dim);
}
.footer__bar a { color: var(--text-dim); }
.footer__bar a:hover { color: var(--accent); }
