/* The Money Method Cohort Portal — shared styles */

:root {
  --teal: #2D5F5D;
  --teal-dark: #1F4544;
  --teal-soft: rgba(45, 95, 93, 0.06);
  --teal-border: rgba(45, 95, 93, 0.15);
  --orange: #F4A261;
  --orange-dark: #E08943;
  --gold: #E9C46A;
  --gold-soft: rgba(233, 196, 106, 0.35);
  --cream: #FDFBF5;
  --off-white: #F8F9FA;
  --ink: #1A1A1A;
  --muted: #6B6B6B;
  --muted-2: #9A9A9A;
  --fine: #E5E0D6;
  --max: 1080px;
}

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

body {
  background: var(--cream);
  color: var(--ink);
  font-family: 'Carlito', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

h1, h2, h3, .display {
  font-family: 'Aileron', sans-serif;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: var(--teal);
}

a { color: var(--teal); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ============ NAV ============ */
nav.portal-nav {
  background: #FFFFFF;
  border-bottom: 1px solid var(--fine);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.logo {
  font-family: 'Aileron', sans-serif;
  font-weight: 800;
  font-size: 16px;
  color: var(--teal);
  letter-spacing: 0.2px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo-dot {
  width: 8px; height: 8px;
  background: var(--orange);
  border-radius: 50%;
  display: inline-block;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 18px;
  font-size: 14px;
}

.nav-link {
  color: var(--muted);
  font-family: 'Aileron', sans-serif;
  font-weight: 600;
  font-size: 14px;
  transition: color 0.15s;
}

.nav-link:hover { color: var(--teal); text-decoration: none; }

.nav-user {
  font-size: 13px;
  color: var(--muted-2);
}

.btn-logout {
  background: transparent;
  border: 1px solid var(--teal-border);
  color: var(--teal);
  padding: 8px 14px;
  border-radius: 6px;
  cursor: pointer;
  font-family: 'Aileron', sans-serif;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.15s;
}

.btn-logout:hover {
  background: var(--teal);
  color: #FFFFFF;
}

/* ============ HERO ============ */
.hero-portal {
  max-width: var(--max);
  margin: 0 auto;
  padding: 60px 24px 40px;
}

.eyebrow {
  display: inline-block;
  font-family: 'Aileron', sans-serif;
  font-size: 12px;
  color: var(--orange);
  text-transform: uppercase;
  letter-spacing: 2.5px;
  font-weight: 700;
  margin-bottom: 18px;
}

h1.page-title {
  font-size: clamp(34px, 5vw, 52px);
  font-weight: 800;
  margin-bottom: 14px;
  letter-spacing: -0.025em;
}

.page-subtitle {
  font-size: clamp(17px, 2vw, 20px);
  color: var(--muted);
  max-width: 56ch;
}

/* ============ DASHBOARD WEEK GRID ============ */
.weeks-grid {
  max-width: var(--max);
  margin: 40px auto 80px;
  padding: 0 24px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.week-card {
  background: #FFFFFF;
  border: 1px solid var(--fine);
  border-radius: 14px;
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
  color: var(--ink);
  position: relative;
  overflow: hidden;
}

.week-card:hover {
  border-color: var(--teal);
  transform: translateY(-3px);
  box-shadow: 0 16px 40px rgba(45, 95, 93, 0.10);
  text-decoration: none;
}

.week-card .week-number {
  font-family: 'Aileron', sans-serif;
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 2px;
  font-weight: 700;
}

.week-card h3 {
  font-size: 22px;
  font-weight: 700;
  color: var(--teal);
  line-height: 1.2;
}

.week-card p {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.5;
}

.week-card .week-cta {
  font-family: 'Aileron', sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: var(--orange);
  letter-spacing: 0.3px;
  margin-top: 8px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: gap 0.2s;
}

.week-card:hover .week-cta { gap: 10px; }

.week-card.locked {
  background: var(--off-white);
  cursor: not-allowed;
  opacity: 0.7;
}

.week-card.locked:hover {
  transform: none;
  border-color: var(--fine);
  box-shadow: none;
}

.week-card.locked .week-cta { color: var(--muted-2); }

.week-card .badge {
  position: absolute;
  top: 16px;
  right: 16px;
  background: var(--gold);
  color: var(--ink);
  font-family: 'Aileron', sans-serif;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
}

.week-card .badge.coming { background: var(--off-white); color: var(--muted); border: 1px solid var(--fine); }
.week-card .badge.bonus { background: var(--orange); color: #FFFFFF; }

.week-card.is-locked {
  cursor: not-allowed;
  opacity: 0.7;
}

.week-card.is-locked:hover {
  transform: none;
  box-shadow: 0 4px 16px rgba(45, 95, 93, 0.06);
}

.week-card.is-locked .week-cta {
  color: var(--muted-2);
}

/* Locked but clickable variant (data-allow-click): faded look, normal interactivity */
.week-card.is-locked.is-locked--clickable {
  cursor: pointer;
}

.week-card.is-locked.is-locked--clickable:hover {
  opacity: 0.9;
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(45, 95, 93, 0.12);
}

/* ============ WEEK PAGE LAYOUT ============ */
.week-content {
  max-width: 880px;
  margin: 0 auto;
  padding: 0 24px 100px;
}

.section-block {
  margin-bottom: 56px;
}

.section-label {
  display: inline-block;
  font-family: 'Aileron', sans-serif;
  font-size: 12px;
  color: var(--orange);
  text-transform: uppercase;
  letter-spacing: 2.5px;
  font-weight: 700;
  margin-bottom: 14px;
}

.section-block h2 {
  font-size: clamp(26px, 3.5vw, 34px);
  font-weight: 700;
  margin-bottom: 18px;
}

.task-list {
  list-style: none;
  padding: 0;
  margin: 0 0 16px;
}

.task-list li {
  position: relative;
  padding: 8px 0 8px 32px;
  font-size: 17px;
  line-height: 1.5;
  color: var(--ink);
}

.task-list li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 18px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--orange);
}

/* ============ INFO CARDS (display-only, not clickable) ============ */
.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
  margin: 16px 0 8px;
}

.info-card {
  background: var(--teal-soft);
  border: 1px solid var(--teal-border);
  border-radius: 12px;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  color: inherit;
}

.info-card .info-icon {
  font-size: 22px;
  flex-shrink: 0;
}

.info-card .info-text { flex: 1; min-width: 0; }

.info-card .info-name {
  font-family: 'Aileron', sans-serif;
  font-weight: 800;
  font-size: 14px;
  color: var(--teal);
  margin-bottom: 2px;
  letter-spacing: -0.01em;
}

.info-card .info-meta {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.4;
}

.info-card--link {
  background: #FFFFFF;
  border: 1px solid var(--teal-border);
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 6px rgba(45, 95, 93, 0.06);
}

.info-card--link:hover {
  border-color: var(--teal);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(45, 95, 93, 0.12);
}

.info-card--link .info-meta { color: var(--orange-dark); font-weight: 700; }

/* ============ COLLAPSIBLE (tap-to-reveal) ============ */
.collapsible {
  background: var(--teal-soft);
  border: 1px solid var(--teal-border);
  border-radius: 14px;
  overflow: hidden;
}

.collapsible-summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px;
  user-select: none;
  transition: background 0.2s ease;
}

.collapsible-summary::-webkit-details-marker { display: none; }
.collapsible-summary::marker { content: ""; display: none; }

.collapsible-summary:hover { background: rgba(45, 95, 93, 0.08); }

.collapsible-heading {
  font-family: 'Aileron', sans-serif;
  font-weight: 800;
  font-size: clamp(20px, 3vw, 26px);
  color: var(--teal);
  line-height: 1.2;
  letter-spacing: -0.01em;
  flex: 1;
}

.collapsible-chevron {
  font-size: 22px;
  color: var(--orange);
  transition: transform 0.3s ease;
  flex-shrink: 0;
  line-height: 1;
}

.collapsible[open] .collapsible-chevron {
  transform: rotate(180deg);
}

.collapsible-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--orange);
  color: #FFFFFF;
  font-family: 'Aileron', sans-serif;
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 10px 18px;
  border-radius: 999px;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(244, 162, 97, 0.35);
  transition: all 0.2s ease;
}

.collapsible-summary:hover .collapsible-trigger {
  background: var(--orange-dark);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(244, 162, 97, 0.45);
}

.trigger-text-open { display: none; }
.collapsible[open] .trigger-text-closed { display: none; }
.collapsible[open] .trigger-text-open { display: inline; }

.trigger-arrow {
  font-size: 14px;
  transition: transform 0.3s ease;
  line-height: 1;
}

.collapsible[open] .trigger-arrow {
  transform: rotate(180deg);
}

@media (max-width: 600px) {
  .collapsible-summary {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }
  .collapsible-trigger { align-self: flex-start; }
}

.collapsible-content {
  padding: 0 24px 22px;
  background: #FFFFFF;
  animation: collapsibleSlide 0.3s ease;
}

.collapsible[open] .collapsible-summary {
  border-bottom: 1px solid var(--teal-border);
  background: #FFFFFF;
}

@keyframes collapsibleSlide {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.collapsible-content .outcomes {
  margin-top: 18px;
}

.outcomes {
  list-style: none;
  padding: 0;
  margin: 0;
  counter-reset: outcome;
}

.outcomes li {
  position: relative;
  padding: 14px 0 14px 56px;
  font-size: 17px;
  line-height: 1.5;
  color: var(--ink);
  border-bottom: 1px solid var(--fine);
  counter-increment: outcome;
}

.outcomes li:last-child {
  border-bottom: none;
}

.outcomes li::before {
  content: counter(outcome, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 12px;
  font-family: 'Aileron', sans-serif;
  font-weight: 800;
  font-size: 15px;
  color: var(--orange-dark);
  letter-spacing: 0.05em;
  background: var(--teal-soft);
  width: 36px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
}

/* ============ SLIDESHOW (image-based, non-downloadable) ============ */
.slideshow {
  position: relative;
  background: var(--ink);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 16px 40px rgba(45, 95, 93, 0.12);
  user-select: none;
  -webkit-user-select: none;
}

.slide-stage {
  aspect-ratio: 16 / 9;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--ink);
}

.slide-stage img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  pointer-events: none;
  -webkit-user-drag: none;
  user-drag: none;
}

.slide-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  border: none;
  font-size: 28px;
  line-height: 1;
  color: var(--teal);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  transition: all 0.18s ease;
  z-index: 2;
  font-family: 'Aileron', sans-serif;
  font-weight: 700;
}

.slide-nav:hover:not(:disabled) {
  background: #FFFFFF;
  transform: translateY(-50%) scale(1.06);
}

.slide-nav:disabled { opacity: 0.35; cursor: not-allowed; }
.slide-prev { left: 16px; }
.slide-next { right: 16px; }

.slide-counter {
  position: absolute;
  bottom: 14px;
  right: 18px;
  background: rgba(0, 0, 0, 0.55);
  color: #FFFFFF;
  font-family: 'Aileron', sans-serif;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.05em;
  padding: 6px 12px;
  border-radius: 999px;
}

@media (max-width: 600px) {
  .slide-nav { width: 40px; height: 40px; font-size: 24px; }
  .slide-prev { left: 8px; }
  .slide-next { right: 8px; }
}

/* ============ TASK CHECKLIST ============ */
.task-heading {
  font-family: 'Aileron', sans-serif;
  font-weight: 800;
  font-size: 20px;
  color: var(--teal);
  margin-bottom: 6px;
  letter-spacing: -0.01em;
}

.checklist {
  list-style: none;
  padding: 0;
  margin: 0 0 18px;
}

.checklist li { margin: 0; }

.check-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 4px;
  border-bottom: 1px solid var(--fine);
  cursor: pointer;
  transition: background 0.15s;
}

.check-item:hover { background: var(--teal-soft); border-radius: 6px; }

.checklist li:last-child .check-item { border-bottom: none; }

.check-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 1px;
  height: 1px;
}

.check-box {
  width: 26px;
  height: 26px;
  border: 2px solid var(--orange);
  border-radius: 6px;
  background: #FFFFFF;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.18s ease;
}

.check-box::after {
  content: "";
  width: 14px;
  height: 8px;
  border-left: 3px solid #FFFFFF;
  border-bottom: 3px solid #FFFFFF;
  transform: rotate(-45deg) translate(1px, -2px);
  opacity: 0;
  transition: opacity 0.18s ease;
}

.check-input:checked + .check-box {
  background: var(--orange);
  border-color: var(--orange);
}

.check-input:checked + .check-box::after { opacity: 1; }

.check-label {
  font-size: 16px;
  color: var(--ink);
  line-height: 1.5;
  flex: 1;
  transition: all 0.18s ease;
}

.check-input:checked ~ .check-label {
  text-decoration: line-through;
  color: var(--muted-2);
}

/* Video embed */
.video-wrap {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  border-radius: 14px;
  background: #000;
  box-shadow: 0 16px 40px rgba(45, 95, 93, 0.12);
}

.video-wrap iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* Quiz embed */
.quiz-wrap {
  background: var(--cream);
  border: 1px solid var(--fine);
  border-radius: 14px;
  overflow: hidden;
}

.quiz-wrap iframe {
  width: 100%;
  height: 480px; /* fallback before postMessage resizes */
  border: 0;
  display: block;
  background: var(--cream);
  transition: height 0.25s ease;
}

/* Resources list */
.resources {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}

.resource-card {
  background: #FFFFFF;
  border: 1px solid var(--fine);
  border-radius: 12px;
  padding: 20px 22px;
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  color: var(--ink);
  transition: all 0.2s;
}

.resource-card:hover {
  border-color: var(--teal);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(45, 95, 93, 0.08);
  text-decoration: none;
}

.resource-icon {
  width: 40px; height: 40px;
  background: var(--teal-soft);
  color: var(--teal);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.resource-info { flex: 1; min-width: 0; }
.resource-name { font-weight: 700; font-size: 15px; color: var(--ink); margin-bottom: 2px; overflow-wrap: anywhere; word-break: break-word; }
.resource-meta { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; word-break: break-word; line-height: 1.4; }
.resource-info { min-width: 0; flex: 1; }

/* Empty state for upcoming weeks */
.empty-state {
  background: var(--off-white);
  border: 2px dashed var(--fine);
  border-radius: 14px;
  padding: 60px 30px;
  text-align: center;
  color: var(--muted);
}

.empty-state h3 {
  font-size: 22px;
  margin-bottom: 8px;
  color: var(--teal);
}

.empty-state p { font-size: 15px; }

/* Week navigation footer */
.week-nav-footer {
  max-width: 880px;
  margin: 40px auto 80px;
  padding: 30px 24px;
  border-top: 1px solid var(--fine);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.week-nav-link {
  font-family: 'Aileron', sans-serif;
  font-weight: 700;
  font-size: 14px;
  color: var(--teal);
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  transition: gap 0.2s;
}

.week-nav-link:hover { gap: 12px; text-decoration: none; }
.week-nav-link.disabled { color: var(--muted-2); pointer-events: none; }

/* ============ LOGIN GATE ============ */
.gate {
  position: fixed;
  inset: 0;
  background: var(--cream);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  padding: 24px;
}

/* Netlify Identity widget iframe must sit above everything else,
   otherwise the login gate covers the modal and the button "does nothing". */
#netlify-identity-widget,
iframe#netlify-identity-widget {
  z-index: 99999 !important;
}

.gate-card {
  max-width: 440px;
  width: 100%;
  background: #FFFFFF;
  border-radius: 20px;
  padding: 48px 36px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(45, 95, 93, 0.10);
  border: 1px solid var(--fine);
}

.gate-card .logo {
  justify-content: center;
  margin-bottom: 32px;
}

.gate-card h1 {
  font-size: 28px;
  font-weight: 800;
  margin-bottom: 12px;
}

.gate-card p {
  color: var(--muted);
  margin-bottom: 28px;
  font-size: 16px;
}

.btn-primary {
  display: inline-block;
  background: var(--orange);
  color: #FFFFFF;
  padding: 16px 32px;
  border-radius: 10px;
  font-family: 'Aileron', sans-serif;
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.2px;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  width: 100%;
}

.btn-primary:hover {
  background: var(--orange-dark);
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(244, 162, 97, 0.28);
}

.gate-help {
  margin-top: 20px;
  font-size: 13px;
  color: var(--muted-2);
}

/* Hide gated content until auth confirms */
.protected { display: none; }
.protected.show { display: block; }

/* ============ MOBILE ============ */
@media (max-width: 720px) {
  .nav-inner { padding: 14px 18px; }
  .nav-right { gap: 12px; }
  .nav-user { display: none; }
  .hero-portal { padding: 40px 18px 30px; }
  .weeks-grid { padding: 0 18px; gap: 14px; }
  .week-content { padding: 0 18px 60px; }
  .section-block { margin-bottom: 40px; }
  .week-nav-footer { padding: 24px 18px; }
  .gate-card { padding: 36px 24px; }
}


/* YouTube logo placeholder inside .video-wrap when replay not yet uploaded */
.video-placeholder-yt {
  position: absolute;
  inset: 0;
  background: #1a1a1a;
  display: flex;
  align-items: center;
  justify-content: center;
}
.video-placeholder-yt svg {
  width: 120px;
  height: auto;
  opacity: 0.85;
  transition: transform 0.3s ease, opacity 0.3s ease;
}
.video-placeholder-yt:hover svg {
  opacity: 1;
  transform: scale(1.04);
}
@media (max-width: 600px) {
  .video-placeholder-yt svg { width: 90px; }
}


/* Welcome headline on home: tighter sizing on mobile so longer fluid greetings don't overflow */
#welcome-headline {
  font-size: clamp(26px, 4.5vw, 42px);
  line-height: 1.15;
  word-break: break-word;
}
@media (max-width: 600px) {
  #welcome-headline { font-size: clamp(22px, 6vw, 30px); }
}
