/* ==============================================
   Agawa Insights — Design Foundation + Form Styles
   ==============================================
   Mobile-first styles. All brand values live in
   CSS variables so future steps can reuse them.
   ============================================== */

/* ---------- Brand Variables ---------- */
:root {
  /* Backgrounds */
  --bg-page:    #161B18;   /* deep near-black with green tint */
  --bg-card:    #1F2723;   /* slightly lighter card surface   */

  /* Accent */
  --accent:     #C8A96E;   /* gold                            */

  /* Text */
  --text:       #F2EFE8;   /* primary off-white               */
  --text-muted: #9AA29B;   /* secondary / captions            */

  /* Borders & dividers */
  --divider:    #2C342F;

  /* Typography */
  --font:       'Inter', sans-serif;

  /* Spacing scale */
  --space-xs:   0.25rem;
  --space-sm:   0.5rem;
  --space-md:   1rem;
  --space-lg:   1.5rem;
  --space-xl:   2rem;
  --space-2xl:  3rem;

  /* Layout */
  --max-width:  720px;     /* content column max-width */
  --radius:     8px;       /* default border-radius    */
}

/* ---------- Reset & Base ---------- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font);
  background-color: var(--bg-page);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  padding: var(--space-md);
}

/* ---------- Brand Wordmark ---------- */
.wordmark {
  font-family: 'Quicksand', sans-serif;
  font-weight: 500;
  font-size: 1.375rem;
  color: var(--text);
  letter-spacing: 0.08em;
  opacity: 0.7;
  margin-bottom: var(--space-lg);
}

/* ---------- State Containers ---------- */
.state-container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--space-xl) 0;
}

/* ---------- Headings ---------- */
h1 {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--accent);
}


/* ==============================================
   PROGRESS BAR
   ============================================== */

.progress-wrapper {
  margin-bottom: var(--space-2xl);
}

.progress-label {
  display: block;
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-bottom: var(--space-sm);
  letter-spacing: 0.02em;
}

.progress-bar {
  width: 100%;
  height: 4px;
  background: var(--divider);
  border-radius: 2px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 10%;                /* default: step 1 of 10 */
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.35s ease;
}


/* ==============================================
   FORM STEPS
   ============================================== */

/* Hide all steps by default; show only the active one */
.form-step {
  display: none;
}

.form-step.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Question label — the main prompt per step */
.question-label {
  display: block;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: var(--space-lg);
  line-height: 1.4;
}

/* Smaller label for grouped fields (step 10) */
.field-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: var(--space-xs);
  margin-top: var(--space-lg);
}

.field-label:first-of-type {
  margin-top: 0;
}


/* ==============================================
   TEXT INPUTS
   ============================================== */

.text-input {
  display: block;
  width: 100%;
  padding: 0.875rem 1rem;
  font-family: var(--font);
  font-size: 1rem;
  color: var(--text);
  background: var(--bg-card);
  border: 1.5px solid var(--divider);
  border-radius: var(--radius);
  outline: none;
  transition: border-color 0.2s ease;
}

.text-input::placeholder {
  color: var(--text-muted);
  opacity: 0.6;
}

.text-input:focus {
  border-color: var(--accent);
}


/* ==============================================
   SINGLE-SELECT OPTION BUTTONS
   ============================================== */

.option-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.option-btn {
  display: block;
  width: 100%;
  padding: 0.875rem 1rem;
  font-family: var(--font);
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text);
  text-align: left;
  background: var(--bg-card);
  border: 1.5px solid var(--divider);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.option-btn:hover {
  border-color: var(--accent);
}

/* Selected state */
.option-btn.selected {
  border-color: var(--accent);
  background: rgba(200, 169, 110, 0.1);
  color: var(--accent);
}


/* ==============================================
   VALIDATION ERROR MESSAGE
   ============================================== */

.error-msg {
  display: block;
  min-height: 1.25rem;
  margin-top: var(--space-sm);
  font-size: 0.8125rem;
  color: #E07A6A;           /* soft red that works on dark bg */
  line-height: 1.4;
}


/* ==============================================
   NAVIGATION BUTTONS (Back / Next)
   ============================================== */

.form-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: var(--space-2xl);
}

/* Shared base for nav buttons */
.nav-btn {
  font-family: var(--font);
  font-size: 0.9375rem;
  font-weight: 600;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius);
  cursor: pointer;
  transition: opacity 0.2s ease, background 0.2s ease;
}

/* Back button — ghost style */
.btn-back {
  background: transparent;
  border: 1.5px solid var(--divider);
  color: var(--text-muted);
}

.btn-back:hover {
  border-color: var(--text-muted);
  color: var(--text);
}

/* Next / Submit button — gold accent */
.btn-next {
  background: var(--accent);
  border: none;
  color: var(--bg-page);
  margin-left: auto;         /* push to right when Back is hidden */
}

.btn-next:hover {
  opacity: 0.9;
}


/* ==============================================
   LOADING STATE
   ============================================== */

.loading-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 50vh;
  text-align: center;
}

.loading-wordmark {
  font-family: 'Quicksand', sans-serif;
  font-weight: 500;
  font-size: 1.75rem;
  color: var(--text);
  letter-spacing: 0.08em;
  opacity: 0.8;
  margin-bottom: var(--space-xl);
}

.loading-message {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: var(--space-xl);
  min-height: 1.6em;          /* prevent layout shift on text swap */
  transition: opacity 0.2s ease;
}

/* Thin gold progress bar with continuous animation */
.loading-bar {
  width: 200px;
  height: 3px;
  background: var(--divider);
  border-radius: 2px;
  overflow: hidden;
}

.loading-bar-fill {
  height: 100%;
  width: 40%;
  background: var(--accent);
  border-radius: 2px;
  animation: loadingSlide 1.4s ease-in-out infinite;
}

@keyframes loadingSlide {
  0%   { transform: translateX(-100%); }
  50%  { transform: translateX(350%); }
  100% { transform: translateX(-100%); }
}


/* ==============================================
   REPORT — General
   ============================================== */

/* Placeholder labels for sections not yet built */
.section-placeholder {
  font-size: 0.8125rem;
  color: var(--text-muted);
  opacity: 0.5;
  padding: var(--space-lg) 0;
  border-bottom: 1px solid var(--divider);
}

/* Shared section label style (small, muted, all-caps) */
.section-label {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: var(--space-sm);
}


/* ==============================================
   S1 — Market Context ("Why Canada Now")
   ============================================== */

.s1 {
  padding: var(--space-2xl) 0;
  text-align: center;
}

.s1-intro {
  font-size: 0.9375rem;
  color: var(--text-muted);
  line-height: 1.6;
  max-width: 560px;
  margin: 0 auto var(--space-2xl);
}

/* 2×2 stat card grid — stacks on mobile */
.stat-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-md);
  text-align: left;
  margin-bottom: var(--space-2xl);
}

/* Individual stat card — reuses blocker-card base look */
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--divider);
  border-radius: 12px;
  padding: 1.5rem;
  opacity: 0;
  transform: translateY(8px);
  animation: cardReveal 0.6s ease forwards;
}

.stat-card:nth-child(2) { animation-delay: 0.1s; }
.stat-card:nth-child(3) { animation-delay: 0.2s; }
.stat-card:nth-child(4) { animation-delay: 0.3s; }

.stat-label {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: var(--space-sm);
}

.stat-figure {
  font-size: 2.5rem;
  font-weight: 300;
  color: var(--text);
  line-height: 1.2;
  margin-bottom: var(--space-xs);
}

.stat-descriptor {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* --- Mini bar chart in Card 1 --- */

.stat-bars {
  display: flex;
  align-items: flex-end;
  gap: var(--space-lg);
  margin-top: var(--space-md);
}

.stat-bar-col {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.stat-bar {
  height: 20px;
  background: var(--accent);
  border-radius: 3px;
  transition: width 0.6s ease-out 0.8s;  /* delay until card has faded in */
}

.stat-bar-year {
  font-size: 0.6875rem;
  color: var(--text-muted);
  margin-top: var(--space-xs);
}

/* --- Context line below the grid --- */

.s1-context-line {
  font-size: 0.8125rem;
  color: var(--text-muted);
  text-align: center;
  padding: var(--space-lg) 0;
  border-top: 1px solid var(--divider);
  letter-spacing: 0.02em;
}


/* ==============================================
   S2 — GTM Readiness Score
   ============================================== */

.s2 {
  padding: var(--space-2xl) 0;
  text-align: center;
}

/* Personalized headline */
.s2-headline {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
  margin-bottom: var(--space-2xl);
}

/* ---------- Gauge ---------- */

.gauge-wrapper {
  display: flex;
  justify-content: center;
  margin-bottom: var(--space-xl);
}

.gauge-svg {
  width: 280px;
  height: auto;
}

/* Background arc (unfilled portion) */
.gauge-bg {
  fill: none;
  stroke: var(--divider);
  stroke-width: 14;
  stroke-linecap: round;
}

/* Foreground arc (score fill) — animated via JS */
.gauge-fill {
  fill: none;
  stroke: url(#gauge-gradient);
  stroke-width: 14;
  stroke-linecap: round;
  transition: stroke-dashoffset 1.2s ease-out;
}

/* Score number in center of gauge */
.gauge-score {
  font-family: var(--font);
  font-size: 72px;
  font-weight: 300;
  fill: var(--text);
}

/* "out of 100" below the number */
.gauge-sub {
  font-family: var(--font);
  font-size: 13px;
  font-weight: 400;
  fill: var(--text-muted);
}

/* ---------- Band pill ---------- */

.band-pill {
  display: inline-block;
  padding: 0.375rem 1.25rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--accent);
  border: 1.5px solid var(--accent);
  border-radius: 100px;
  margin-bottom: var(--space-lg);
}

/* Band message */
.band-message {
  font-size: 0.9375rem;
  font-style: italic;
  color: var(--text-muted);
  line-height: 1.6;
  max-width: 520px;
  margin: 0 auto;
}


/* ---------- Blocker Cards ---------- */

.blockers-section {
  margin-top: var(--space-2xl);
  padding-top: var(--space-2xl);
  border-top: 1px solid var(--divider);
  text-align: left;
}

.blockers-label {
  text-align: center;
  margin-bottom: var(--space-xl);
}

.blockers-grid {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.blocker-card {
  background: var(--bg-card);
  border: 1px solid var(--divider);
  border-radius: 12px;
  padding: 1.5rem;
}

.blocker-number {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: var(--space-sm);
}

.blocker-factor {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: var(--space-sm);
}

.blocker-copy {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.6;
}


/* ==============================================
   S3 — Pipeline Potential
   ============================================== */

.s3 {
  padding: var(--space-2xl) 0;
  border-top: 1px solid var(--divider);
}

.s3-label {
  text-align: center;
  margin-bottom: var(--space-sm);
}

.s3-headline {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
  text-align: center;
  margin-bottom: var(--space-2xl);
}

/* --- Range bar block (shared between Prize and Hard Way) --- */

.range-block {
  margin-bottom: var(--space-2xl);
}

.range-block:last-of-type {
  margin-bottom: var(--space-xl);
}

.range-label {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: var(--space-md);
}

/* The figures sit above the bar, left and right */
.range-figures {
  display: flex;
  justify-content: space-between;
  margin-bottom: var(--space-xs);
}

.range-figure {
  font-size: 1.375rem;
  font-weight: 400;
  color: var(--text);
}

/* The full track */
.range-track {
  width: 100%;
  height: 24px;
  background: var(--divider);
  border-radius: 12px;
  overflow: hidden;
  position: relative;
}

/* The filled band inside the track */
.range-band {
  height: 100%;
  border-radius: 12px;
  width: 0;                          /* starts collapsed, animated via JS */
  transition: width 1s ease-out;
}

/* Gold band for The Prize */
.range-band--prize {
  background: var(--accent);
}

/* Muted band for The Hard Way */
.range-band--cost {
  background: #6B7269;
}

.range-caption {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: var(--space-sm);
  line-height: 1.5;
}

/* Bridge sentence below both blocks */
.s3-bridge {
  font-size: 0.9375rem;
  font-style: italic;
  color: var(--text-muted);
  text-align: center;
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.6;
}


/* ==============================================
   S4 — Competitive Gap Map
   ============================================== */

.s4 {
  padding: var(--space-2xl) 0;
  border-top: 1px solid var(--divider);
}

.s4-label {
  text-align: center;
  margin-bottom: var(--space-sm);
}

.s4-headline {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
  text-align: center;
  margin-bottom: var(--space-2xl);
}

/* --- Incumbent card --- */

.gap-card-incumbent {
  background: var(--bg-card);
  border: 1px solid var(--divider);
  border-radius: 12px;
  padding: 1.75rem;
  max-width: var(--max-width);
  margin: 0 auto;
  opacity: 0;
  transform: translateY(8px);
  animation: cardReveal 0.6s ease forwards;
}

.gap-card-label {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: var(--space-md);
}

.gap-card-label--gold {
  color: var(--accent);
}

.gap-card-body {
  font-size: 0.9375rem;
  color: var(--text-muted);
  line-height: 1.7;
}

/* --- Connector phrase --- */

.gap-connector {
  text-align: center;
  padding: 2rem 0;
  font-size: 0.9375rem;
  font-style: italic;
  color: var(--text-muted);
}

/* --- Niche card (gold left edge) --- */

.gap-card-niche {
  background: var(--bg-card);
  border: 1px solid var(--divider);
  border-left: 3px solid var(--accent);
  border-radius: 12px;
  padding: 1.75rem;
  max-width: var(--max-width);
  margin: 0 auto;
  opacity: 0;
  transform: translateY(8px);
  animation: cardReveal 0.6s ease 0.2s forwards;
}

.gap-card-heading {
  font-size: 1.125rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: var(--space-md);
}

.gap-card-divider {
  border: none;
  border-top: 1px solid var(--divider);
  margin: var(--space-lg) 0;
}

.gap-card-tailwind {
  font-size: 0.8125rem;
  font-style: italic;
  color: var(--text-muted);
  line-height: 1.6;
}

@keyframes cardReveal {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}


/* ==============================================
   S5 — CTA Bridge to Audit
   ============================================== */

.s5 {
  padding: 4.5rem 0;
  border-top: 1px solid var(--divider);
  text-align: center;
}

.s5-label {
  margin-bottom: var(--space-sm);
}

.s5-headline {
  font-size: 1.375rem;
  font-weight: 400;
  color: var(--text);
  line-height: 1.5;
  margin-bottom: var(--space-xl);
}

.s5-body {
  font-size: 0.9375rem;
  color: var(--text-muted);
  line-height: 1.7;
  max-width: 560px;
  margin: 0 auto var(--space-2xl);
}

.cta-button {
  display: inline-block;
  text-decoration: none;
  padding: 1rem 2rem;
  font-family: var(--font);
  font-size: 0.9375rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--bg-page);
  background: var(--accent);
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.2s ease;
}

.cta-button:hover {
  background: #D4B87A;
}

.s5-fine-print {
  margin-top: var(--space-lg);
  font-size: 0.75rem;
  color: var(--text-muted);
  opacity: 0.7;
}


/* ==============================================
   SUBMIT ERROR MESSAGE
   ============================================== */

.submit-error {
  margin-top: var(--space-md);
  font-size: 0.8125rem;
  color: #E07A6A;
  line-height: 1.5;
}


/* ==============================================
   RESPONSIVE — Tablet & Up
   ============================================== */

@media (min-width: 640px) {
  body {
    padding: var(--space-xl);
  }

  h1 {
    font-size: 2rem;
  }

  .question-label {
    font-size: 1.5rem;
  }

  /* On wider screens, let shorter option lists sit in a grid */
  .option-group {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-sm);
  }

  /* S2: larger gauge on desktop */
  .gauge-svg {
    width: 360px;
  }

  .s2-headline {
    font-size: 1.5rem;
  }

  .s3-headline {
    font-size: 1.5rem;
  }

  .s4-headline {
    font-size: 1.5rem;
  }

  .s5-headline {
    font-size: 1.625rem;
  }
}

/* Blocker cards: 3-column on wider screens */
/* Stat grid: 2-column on wider screens */
@media (min-width: 768px) {
  .blockers-grid {
    flex-direction: row;
    gap: var(--space-md);
  }

  .blocker-card {
    flex: 1;
  }

  .stat-grid {
    grid-template-columns: 1fr 1fr;
  }

  .stat-figure {
    font-size: 3rem;
  }
}
