/* Self Align by Design — course platform (paper world).
   Black & white + one rose accent (#FF1D58), Cormorant + DM Sans.
   Variable names are kept for continuity; values now map to the brand
   system (forest→near-black, sage/terra→rose, cream→paper, ghost→sand). */
:root {
  --cream:      #FAFAF9;   /* page background — paper */
  --cream-mid:  #F1F1F0;   /* alternating band */
  --cream-dark: #E2E2E0;   /* track / draft badge fill */
  --forest:     #0B0B0B;   /* headings, dark surfaces — near-black */
  --sage:       #FF1D58;   /* links, emphasis, accents — rose */
  --sage-mid:   #FF1D58;   /* focus, progress fill, completed state — rose */
  --sage-pale:  #FFB3C9;   /* light rose on dark (video placeholder) */
  --sage-ghost: #EDE7E0;   /* quiet warm fill — sand */
  --terra:      #FF1D58;   /* primary button — rose */
  --terra-light:#E2003F;   /* primary button hover — rose-600 */
  --text:       #1A1A19;   /* body ink */
  --text-mid:   #5A5A57;   /* secondary text */
  --text-muted: #9A9A96;   /* tertiary / captions */
  --border:     rgba(11, 11, 11, 0.12);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: var(--cream);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-weight: 300;
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  min-height: 100%;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { font-family: 'Cormorant Garamond', serif; font-weight: 500; color: var(--forest); line-height: 1.15; }
em, .italic { font-style: italic; color: var(--sage); }
a { color: var(--sage); text-decoration: none; }
a:hover { color: var(--forest); }

/* Nav */
.nav { background: rgba(250,248,243,0.92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 50; }
.nav-inner { max-width: 1100px; margin: 0 auto; padding: 0 24px; height: 64px; display: flex; align-items: center; justify-content: space-between; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark { width: 30px; height: 30px; }
.brand-word { font-family: 'Cormorant Garamond', serif; font-style: normal; font-weight: 500; font-size: 20px; color: var(--forest); letter-spacing: 0.01em; }
.brand-word em { font-style: italic; color: var(--sage); }
.nav-links { display: flex; align-items: center; gap: 20px; font-size: 14px; }
.nav-name { color: var(--text-muted); font-size: 13px; }
.inline { display: inline; }
.link-btn { background: none; border: none; color: var(--sage); font: inherit; font-size: 14px; cursor: pointer; padding: 0; }
.link-btn:hover { color: var(--forest); }

/* Layout */
.main { flex: 1 0 auto; max-width: 1100px; width: 100%; margin: 0 auto; padding: 40px 24px 64px; }
.narrow { max-width: 460px; margin: 48px auto; }
.footer { flex-shrink: 0; border-top: 1px solid var(--border); padding: 28px 24px; display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; font-size: 12px; color: var(--text-muted); max-width: 1100px; margin: 0 auto; width: 100%; }

/* Flash */
.flash { max-width: 1100px; margin: 16px auto 0; padding: 12px 20px; border-radius: 10px; font-size: 14px; }
.flash-success { background: var(--sage-ghost); color: var(--sage); border: 1px solid rgba(255,29,88,0.22); }
.flash-error { background: #FFE4EC; color: #C20030; border: 1px solid rgba(194,0,48,0.25); }

/* Buttons */
.btn { display: inline-block; background: var(--terra); color: #fff; border: none; border-radius: 8px; padding: 12px 24px; font: inherit; font-weight: 500; font-size: 15px; cursor: pointer; transition: background .2s, transform .15s; }
.btn:hover { background: var(--terra-light); color: #fff; transform: translateY(-1px); }
.btn-sm { padding: 8px 16px; font-size: 13px; }
.btn-ghost { background: transparent; color: var(--sage); border: 1px solid var(--sage-mid); }
.btn-ghost:hover { background: var(--sage-ghost); color: var(--forest); }
.btn-block { width: 100%; text-align: center; }
.btn-danger { background: transparent; color: var(--text-muted); border: 1px solid var(--border); }
.btn-danger:hover { background: #FFE4EC; color: #C20030; }

/* Forms */
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; font-weight: 500; color: var(--text-mid); margin-bottom: 6px; }
.field input[type=text], .field input[type=email], .field input[type=password], .field textarea, .field select {
  width: 100%; padding: 11px 14px; border: 1px solid var(--border); border-radius: 8px; background: #fff;
  font: inherit; font-size: 15px; color: var(--text); outline: none; transition: border-color .2s;
}
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--sage-mid); }
.field textarea { min-height: 160px; resize: vertical; font-size: 14px; line-height: 1.6; }
.field .hint { font-size: 12px; color: var(--text-muted); margin-top: 5px; }
.checkbox { display: flex; align-items: center; gap: 9px; font-size: 14px; color: var(--text-mid); }
.checkbox input { width: 16px; height: 16px; }
.row { display: flex; gap: 16px; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 180px; }

/* Cards */
.card { background: #fff; border: 1px solid var(--border); border-radius: 14px; padding: 28px; }
.eyebrow { font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--sage); font-weight: 500; margin-bottom: 12px; }
.page-head { margin-bottom: 28px; }
.page-head h1 { font-size: 38px; }
.page-head p { color: var(--text-mid); margin-top: 6px; }
.muted { color: var(--text-muted); }
.section-gap { margin-top: 36px; }

/* Course grid */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }
.course-card { background: #fff; border: 1px solid var(--border); border-radius: 14px; padding: 26px; transition: transform .2s, box-shadow .2s; display: block; }
.course-card:hover { transform: translateY(-3px); box-shadow: 0 10px 30px rgba(11,11,11,0.08); }
.course-emoji { font-size: 34px; display: block; margin-bottom: 12px; }
.course-card h3 { font-size: 23px; margin-bottom: 6px; }
.course-card p { font-size: 14px; color: var(--text-mid); }
.badge { display: inline-block; font-size: 11px; letter-spacing: .05em; text-transform: uppercase; padding: 3px 10px; border-radius: 100px; font-weight: 500; }
.badge-draft { background: var(--cream-dark); color: var(--text-mid); }
.badge-published { background: var(--sage-ghost); color: var(--sage); }
.badge-free { background: var(--terra); color: #fff; }
.progress { height: 6px; background: var(--cream-dark); border-radius: 100px; margin-top: 14px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--sage-mid); }

/* Course outline */
.outline { list-style: none; }
.outline .sec { margin-top: 26px; }
.outline .sec-title { font-family: 'Cormorant Garamond', serif; font-size: 22px; color: var(--forest); margin-bottom: 8px; }
.lesson-row { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border: 1px solid var(--border); border-radius: 10px; margin-bottom: 8px; background: #fff; }
.lesson-row .ico { width: 24px; height: 24px; border-radius: 50%; background: var(--sage-ghost); color: var(--sage); display: flex; align-items: center; justify-content: center; font-size: 13px; flex-shrink: 0; }
.lesson-row.done .ico { background: var(--sage-mid); color: #fff; }
.lesson-row .t { flex: 1; font-size: 15px; color: var(--text); }
.lesson-row .lock { color: var(--text-muted); font-size: 13px; }

/* Lesson player */
.player-wrap { display: grid; grid-template-columns: 1fr 300px; gap: 32px; align-items: start; }
.video-frame { aspect-ratio: 16/9; width: 100%; background: var(--forest); border-radius: 14px; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.video-frame video, .video-frame iframe { width: 100%; height: 100%; border: 0; display: block; }
.video-empty { color: var(--sage-pale); font-size: 14px; text-align: center; padding: 24px; }
.lesson-body { margin-top: 26px; font-size: 16px; color: var(--text-mid); line-height: 1.8; }
.lesson-body h1, .lesson-body h2, .lesson-body h3 { margin: 22px 0 10px; }
.lesson-body p { margin-bottom: 14px; }
.lesson-body ul, .lesson-body ol { margin: 0 0 14px 22px; }
.lesson-nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 32px; }
.side-outline { background: #fff; border: 1px solid var(--border); border-radius: 14px; padding: 18px; position: sticky; top: 84px; }
.side-outline .sec-title { font-size: 18px; margin: 14px 0 6px; }
.side-outline .sec-title:first-child { margin-top: 0; }
.side-outline a { display: block; padding: 8px 10px; border-radius: 8px; font-size: 14px; color: var(--text-mid); }
.side-outline a:hover { background: var(--cream-mid); }
.side-outline a.active { background: var(--sage-ghost); color: var(--forest); font-weight: 500; }
.side-outline a .check { color: var(--sage-mid); }

/* Auth hero */
.auth-head { text-align: center; margin-bottom: 28px; }
.auth-head h1 { font-size: 34px; }
.auth-head p { color: var(--text-mid); margin-top: 6px; font-size: 15px; }
.alt-line { text-align: center; margin-top: 18px; font-size: 14px; color: var(--text-mid); }

/* Landing */
.hero { text-align: center; padding: 30px 0 10px; }
.hero h1 { font-size: clamp(36px, 6vw, 60px); }
.hero h1 em { color: var(--sage); }
.hero p { max-width: 560px; margin: 18px auto 28px; font-size: 17px; color: var(--text-mid); }
.cta-row { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 8px; }
.stack-sm > * + * { margin-top: 10px; }
table.members { width: 100%; border-collapse: collapse; font-size: 14px; }
table.members th, table.members td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); }
table.members th { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); font-weight: 500; }

@media (max-width: 760px) {
  .player-wrap { grid-template-columns: 1fr; }
  .side-outline { position: static; }
}
