/* ─────────────────────────────────────────────────────────────────────────
   Dream Home Fund Financial Education Course — Shared styles
   ───────────────────────────────────────────────────────────────────────── */

:root {
  --green-dark: #1a3320;
  --green-mid: #24472e;
  --gold: #b8922a;
  --gold-light: #d4a84b;
  --cream: #faf8f3;
  --cream-dark: #f0ece2;
  --white: #ffffff;
  --text-dark: #1a3320;
  --text-muted: #6b7c6e;
  --text-body: #3d4f40;
  --success: #2d6a3e;
  --error: #c0392b;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--cream);
  color: var(--text-body);
  font-size: 16px;
  line-height: 1.75;
}
body::before {
  content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA0MDAgNDAwIiB3aWR0aD0iNDAwIiBoZWlnaHQ9IjQwMCI+IDxnIHRyYW5zZm9ybT0idHJhbnNsYXRlKDIwMCwgMjAwKSBzY2FsZSgyLjQpIHRyYW5zbGF0ZSgwLCAtMTMpIj4gPHBhdGggZD0iTSAtNDAgLTQgTCAtNDAgLTE4IEwgLTI4IC0xOCBMIC0yOCAtNCBMIC0xMiAtNCBMIC0xMiAtMTggTCAxMiAtMTggTCAxMiAtNCBMIDI4IC00IEwgMjggLTE4IEwgNDAgLTE4IEwgNDAgLTQgTCA0MCA0NCBMIC00MCA0NCBaIiBzdHJva2U9IiMxYTNhMmUiIHN0cm9rZS13aWR0aD0iMiIgZmlsbD0ibm9uZSIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIi8+IDxwYXRoIGQ9Ik0gLTEwIDQ0IEwgLTEwIDIyIFEgLTEwIDEyIDAgMTIgUSAxMCAxMiAxMCAyMiBMIDEwIDQ0IFoiIGZpbGw9IiNjOWE5NjEiIHN0cm9rZT0iIzFhM2EyZSIgc3Ryb2tlLXdpZHRoPSIxLjUiIHN0cm9rZS1saW5lam9pbj0icm91bmQiLz4gPC9nPiA8L3N2Zz4=");
  background-repeat: repeat; background-size: 160px; opacity: 0.04;
}

/* Course chrome (top bar replaces site nav for focused course experience) */
.course-chrome {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: rgba(250,248,243,0.97);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(26,51,32,0.1);
  padding: 0 5vw;
  display: flex; align-items: center; justify-content: space-between;
  height: 72px;
  font-size: 0.875rem;
}
.course-chrome-left { display: flex; align-items: center; gap: 1.5rem; }
.course-chrome-logo { display: flex; align-items: center; text-decoration: none; color: var(--green-dark); }
.course-chrome-logo svg { height: 36px; }
.course-chrome-title {
  font-weight: 500; color: var(--green-dark);
  letter-spacing: 0.02em;
  display: none;
}
@media (min-width: 700px) {
  .course-chrome-title { display: block; }
}
.course-chrome-exit {
  color: var(--text-muted); text-decoration: none;
  font-size: 0.85rem;
  border-bottom: 1px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}
.course-chrome-exit:hover { color: var(--green-dark); border-bottom-color: rgba(26,51,32,0.3); }

/* Progress strip */
.course-progress-strip {
  position: fixed; top: 72px; left: 0; right: 0; z-index: 99;
  background: var(--cream-dark);
  height: 4px;
  overflow: hidden;
}
.course-progress-fill {
  height: 100%;
  background: var(--gold);
  width: 0%;
  transition: width 0.4s ease;
}

/* Page wrapper */
.course-wrap {
  max-width: 760px; margin: 0 auto;
  padding: 132px 2rem 5rem;
}

/* Module eyebrow & title */
.module-eyebrow {
  font-size: 0.7rem; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--gold); font-weight: 600; margin-bottom: 0.75rem;
  display: flex; align-items: center; gap: 0.6rem;
}
.module-eyebrow::before {
  content: ''; display: block; width: 3px; height: 14px;
  background: var(--gold); border-radius: 2px;
}
.module-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(1.9rem, 3.5vw, 2.6rem);
  font-weight: 400; color: var(--green-dark);
  line-height: 1.15; margin-bottom: 1.5rem;
}
.module-lead {
  font-size: 1.05rem; color: var(--text-muted);
  line-height: 1.85; margin-bottom: 2.5rem;
}

/* Content blocks */
.module-body h2 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.6rem; font-weight: 400;
  color: var(--green-dark); margin: 2.5rem 0 1rem; line-height: 1.25;
}
.module-body h3 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.25rem; font-weight: 500;
  color: var(--green-dark); margin: 2rem 0 0.75rem; line-height: 1.3;
}
.module-body p {
  font-size: 1rem; color: var(--text-body);
  line-height: 1.85; margin-bottom: 1.1rem;
}
.module-body ul, .module-body ol {
  margin: 0.75rem 0 1.25rem 1.5rem;
}
.module-body li {
  font-size: 1rem; color: var(--text-body);
  line-height: 1.85; margin-bottom: 0.5rem;
}
.module-body strong { color: var(--green-dark); }
.module-body a {
  color: var(--green-dark);
  border-bottom: 1px solid rgba(184,146,42,0.3);
  text-decoration: none;
}
.module-body a:hover { border-bottom-color: var(--gold); }

/* Highlight / callout */
.module-callout {
  background: var(--white);
  border: 1px solid rgba(26,51,32,0.08);
  border-left: 3px solid var(--gold);
  border-radius: 6px;
  padding: 1.25rem 1.5rem;
  margin: 1.5rem 0;
  font-size: 0.975rem; line-height: 1.8;
}
.module-callout strong { color: var(--green-dark); }
.module-callout .label {
  display: block;
  font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--gold); font-weight: 600; margin-bottom: 0.4rem;
}

/* Video placeholder (until real videos are recorded) */
.module-video {
  background: var(--green-dark);
  border-radius: 8px;
  aspect-ratio: 16 / 9;
  display: flex; align-items: center; justify-content: center;
  margin: 1.5rem 0 2rem;
  position: relative;
  overflow: hidden;
}
.module-video::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(circle at 30% 30%, rgba(184,146,42,0.18), transparent 60%);
}
.module-video .video-placeholder {
  position: relative; text-align: center; color: rgba(255,255,255,0.7);
  font-size: 0.875rem; letter-spacing: 0.08em;
}
.module-video .video-placeholder .play-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 56px; height: 56px; border-radius: 50%;
  background: rgba(184,146,42,0.95); margin-bottom: 0.75rem;
  font-size: 1.25rem; color: var(--green-dark);
}
.module-video iframe { width: 100%; height: 100%; border: 0; }

/* Animated SVG diagrams */
.diagram-wrap {
  background: var(--white);
  border: 1px solid rgba(26,51,32,0.08);
  border-radius: 8px;
  padding: 1.5rem 1.5rem 1rem;
  margin: 1.5rem 0 2rem;
}
.diagram-wrap .diagram-caption {
  font-size: 0.85rem; color: var(--text-muted);
  text-align: center; margin-top: 0.75rem;
  font-style: italic;
}
.diagram-wrap svg { display: block; width: 100%; height: auto; max-height: 360px; }

/* Quiz block */
.quiz-block {
  background: var(--white);
  border: 1px solid rgba(26,51,32,0.1);
  border-top: 3px solid var(--gold);
  border-radius: 10px;
  padding: 2rem 2rem 1.5rem;
  margin: 3rem 0 1rem;
  box-shadow: 0 8px 32px rgba(26,51,32,0.06);
}
.quiz-block h2 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.5rem; font-weight: 500;
  color: var(--green-dark); margin: 0 0 0.5rem;
}
.quiz-block .quiz-intro {
  font-size: 0.95rem; color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.quiz-question {
  padding: 1rem 0 1.5rem;
  border-bottom: 1px solid rgba(26,51,32,0.06);
}
.quiz-question:last-of-type { border-bottom: none; }
.quiz-question .q-text {
  font-size: 1rem; color: var(--green-dark);
  font-weight: 500; margin-bottom: 0.85rem;
  line-height: 1.55;
}
.quiz-options { list-style: none; padding: 0; margin: 0; }
.quiz-options li { margin-bottom: 0.5rem; }
.quiz-options label {
  display: block;
  padding: 0.75rem 1rem;
  border: 1.5px solid rgba(26,51,32,0.15);
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.95rem; line-height: 1.5;
  color: var(--text-body);
  transition: all 0.15s;
  user-select: none;
}
.quiz-options label:hover {
  border-color: var(--gold);
  background: var(--cream);
}
.quiz-options input[type="radio"] {
  margin-right: 0.6rem;
  accent-color: var(--gold);
}
.quiz-options input[type="radio"]:checked + .option-text { color: var(--green-dark); font-weight: 500; }
.quiz-options label.option-correct {
  border-color: var(--success);
  background: rgba(45,106,62,0.06);
  color: var(--success);
}
.quiz-options label.option-incorrect {
  border-color: var(--error);
  background: rgba(192,57,43,0.06);
  color: var(--error);
}

.quiz-feedback {
  display: none;
  margin-top: 0.6rem;
  padding: 0.65rem 0.85rem;
  border-radius: 4px;
  font-size: 0.875rem;
  line-height: 1.65;
}
.quiz-feedback.show { display: block; }
.quiz-feedback.correct { background: rgba(45,106,62,0.08); color: var(--success); border-left: 3px solid var(--success); }
.quiz-feedback.incorrect { background: rgba(192,57,43,0.06); color: var(--error); border-left: 3px solid var(--error); }

.quiz-actions {
  display: flex; gap: 0.75rem; align-items: center; flex-wrap: wrap;
  margin-top: 1.5rem;
}
.quiz-result {
  font-size: 0.95rem; font-weight: 500;
  display: none;
}
.quiz-result.show { display: inline-flex; align-items: center; gap: 0.4rem; }
.quiz-result.pass { color: var(--success); }
.quiz-result.fail { color: var(--error); }

/* Buttons */
.btn {
  display: inline-block;
  background: var(--green-dark);
  color: var(--cream);
  padding: 0.85rem 1.75rem;
  border-radius: 4px;
  border: none;
  font-family: inherit;
  font-size: 0.95rem; font-weight: 500;
  letter-spacing: 0.03em;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, opacity 0.15s, transform 0.05s;
}
.btn:hover { background: var(--green-mid); }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn.disabled {
  background: rgba(26,51,32,0.25);
  cursor: not-allowed;
}
.btn.btn-gold {
  background: var(--gold); color: var(--green-dark);
}
.btn.btn-gold:hover { background: var(--gold-light); }
.btn.btn-outline {
  background: transparent;
  color: var(--green-dark);
  border: 1.5px solid rgba(26,51,32,0.25);
}
.btn.btn-outline:hover { border-color: var(--green-dark); background: var(--cream-dark); }

/* Module navigation footer */
.module-nav {
  display: flex; justify-content: space-between; gap: 1rem;
  margin-top: 3rem; padding-top: 2rem;
  border-top: 1px solid rgba(26,51,32,0.08);
  flex-wrap: wrap;
}
.module-nav-prev, .module-nav-next { flex: 0 1 auto; }
.module-nav-prev .label, .module-nav-next .label {
  display: block;
  font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--text-muted); margin-bottom: 0.25rem;
}
.module-nav-prev .title, .module-nav-next .title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1rem; color: var(--green-dark);
}
.module-nav a {
  text-decoration: none;
  display: inline-block;
  padding: 0.75rem 1.25rem;
  border-radius: 6px;
  border: 1px solid rgba(26,51,32,0.1);
  background: var(--white);
  transition: border-color 0.15s, background 0.15s;
}
.module-nav a:hover { border-color: var(--gold); background: var(--cream); }
.module-nav-next.disabled a {
  pointer-events: none; opacity: 0.4;
}

/* Module index (start page) */
.course-intro {
  background: var(--white);
  border: 1px solid rgba(26,51,32,0.1);
  border-top: 3px solid var(--gold);
  border-radius: 10px;
  padding: 2.25rem 2.25rem;
  margin-bottom: 2.5rem;
  box-shadow: 0 8px 32px rgba(26,51,32,0.06);
}
.course-intro h1 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.9rem; font-weight: 400;
  color: var(--green-dark); margin-bottom: 1rem;
}
.course-intro p {
  font-size: 0.975rem; color: var(--text-muted);
  line-height: 1.85; margin-bottom: 1rem;
}
.course-intro p:last-child { margin-bottom: 0; }

.identity-form {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1rem;
  margin: 1.5rem 0;
}
.identity-form .field-full { grid-column: 1 / -1; }
.identity-form label {
  display: block;
  font-size: 0.8rem; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--text-muted); font-weight: 600;
  margin-bottom: 0.4rem;
}
.identity-form input, .identity-form select {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1.5px solid rgba(26,51,32,0.15);
  border-radius: 6px;
  font-family: inherit; font-size: 0.95rem;
  color: var(--green-dark); background: var(--white);
  transition: border-color 0.15s;
}
.identity-form input:focus, .identity-form select:focus {
  outline: none; border-color: var(--gold);
}
.identity-form .error-msg {
  color: var(--error); font-size: 0.85rem;
  margin-top: 0.4rem; display: none;
}
.identity-form .error-msg.show { display: block; }
@media (max-width: 600px) {
  .identity-form { grid-template-columns: 1fr; }
}

/* Module list on start page */
.module-list {
  list-style: none; padding: 0; margin: 0;
}
.module-list li {
  display: flex; align-items: flex-start; gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid rgba(26,51,32,0.06);
}
.module-list li:last-child { border-bottom: none; }
.module-list .num {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.5rem; font-weight: 500;
  color: var(--gold); line-height: 1;
  flex-shrink: 0; min-width: 2rem;
}
.module-list .title {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.95rem; font-weight: 600;
  color: var(--green-dark); margin-bottom: 0.15rem;
}
.module-list .desc {
  font-size: 0.85rem; color: var(--text-muted);
  line-height: 1.65;
}
.module-list .status {
  margin-left: auto; font-size: 0.75rem;
  color: var(--text-muted); flex-shrink: 0;
  align-self: center;
}
.module-list .status.done { color: var(--success); font-weight: 600; }

/* Certificate */
.certificate {
  background: var(--white);
  border: 4px double var(--gold);
  border-radius: 8px;
  padding: 3rem 2.5rem;
  text-align: center;
  position: relative;
  margin: 1rem 0 2rem;
  box-shadow: 0 12px 48px rgba(26,51,32,0.1);
}
.certificate::before {
  content: ''; position: absolute; inset: 0.5rem;
  border: 1px solid rgba(184,146,42,0.4);
  border-radius: 4px;
  pointer-events: none;
}
.certificate .cert-eyebrow {
  font-size: 0.75rem; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--gold); font-weight: 600; margin-bottom: 0.5rem;
}
.certificate .cert-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 2rem; font-weight: 400;
  color: var(--green-dark); margin-bottom: 0.5rem;
  line-height: 1.2;
}
.certificate .cert-program {
  font-size: 0.95rem; color: var(--text-muted);
  margin-bottom: 2rem;
}
.certificate .cert-awarded {
  font-size: 0.85rem; color: var(--text-muted);
  letter-spacing: 0.04em; margin-bottom: 0.5rem;
}
.certificate .cert-name {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.85rem; font-style: italic;
  color: var(--green-dark); margin-bottom: 2rem;
  padding: 0 1rem 0.5rem;
  border-bottom: 1px solid rgba(184,146,42,0.3);
  display: inline-block;
}
.certificate .cert-detail {
  display: flex; justify-content: space-around; gap: 2rem; flex-wrap: wrap;
  margin-top: 2rem; padding-top: 1.5rem;
  border-top: 1px solid rgba(26,51,32,0.08);
}
.certificate .cert-detail .field {
  font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--text-muted); font-weight: 600; margin-bottom: 0.3rem;
}
.certificate .cert-detail .value {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem; color: var(--green-dark);
}
.certificate .cert-id {
  font-family: 'SF Mono', Monaco, Consolas, monospace;
  font-size: 0.85rem; color: var(--text-muted);
  margin-top: 1rem;
}

/* Footer (course pages have a minimal footer) */
.course-footer {
  text-align: center;
  margin-top: 4rem; padding: 2rem 0;
  border-top: 1px solid rgba(26,51,32,0.08);
  font-size: 0.8rem; color: var(--text-muted);
}
.course-footer a { color: var(--text-muted); text-decoration: none; }
.course-footer a:hover { color: var(--green-dark); }

/* Print */
@media print {
  .course-chrome, .course-progress-strip, .course-footer,
  .quiz-block, .module-nav, .module-video { display: none !important; }
  body::before { display: none !important; }
  body { background: var(--white); font-size: 11pt; }
  .course-wrap { padding: 1rem 0; max-width: 100%; }
  .certificate { box-shadow: none; page-break-inside: avoid; }
}
