/* ============================================
   Construction Financial Health Score
   Brand: Navy (#1B2A4A) + Gold (#D4A84B)
   ============================================ */

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

:root {
  --navy: #1B2A4A;
  --navy-light: #2D4470;
  --gold: #D4A84B;
  --gold-light: #E4C577;
  --gold-dark: #B8912F;
  --white: #FFFFFF;
  --gray-50: #F8F9FA;
  --gray-100: #F1F3F5;
  --gray-200: #E2E8F0;
  --gray-400: #94A3B8;
  --gray-600: #4A5568;
  --gray-800: #1E293B;
  --red: #DC2626;
  --red-bg: #FEF2F2;
  --yellow: #D4A84B;
  --yellow-bg: #FFFBEB;
  --green: #16A34A;
  --green-bg: #F0FDF4;
  --radius: 12px;
  --shadow: 0 2px 8px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
  --max-width: 720px;
  --transition: 0.3s ease;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--gray-600);
  background: var(--white);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* --- Screens --- */
.screen { display: none; opacity: 0; transition: opacity var(--transition); }
.screen.active { display: block; opacity: 1; }

/* --- Typography --- */
h1, h2, h3 { color: var(--navy); font-weight: 700; line-height: 1.2; }
h1 { font-size: clamp(1.75rem, 4vw, 2.5rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
h3 { font-size: 1.25rem; }
p { margin-bottom: 1rem; }

/* --- Buttons --- */
.btn-primary {
  display: inline-block;
  background: var(--gold);
  color: var(--navy);
  font-weight: 600;
  font-size: 1.1rem;
  padding: 14px 32px;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
}
.btn-primary:hover { background: var(--gold-dark); transform: translateY(-1px); box-shadow: var(--shadow-lg); }

.btn-secondary {
  display: inline-block;
  background: transparent;
  color: var(--navy);
  font-weight: 600;
  font-size: 1rem;
  padding: 12px 24px;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
}
.btn-secondary:hover { border-color: var(--navy); background: var(--gray-50); }

.btn-nav {
  background: none;
  border: none;
  color: var(--gray-400);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  padding: 8px 16px;
  transition: color var(--transition);
}
.btn-nav:hover { color: var(--navy); }
.btn-nav:disabled { opacity: 0.3; cursor: not-allowed; }

/* --- Container --- */
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 20px; }

/* ==============================
   LANDING PAGE
   ============================== */
.hero {
  text-align: center;
  padding: 80px 20px 40px;
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%);
  color: var(--white);
}
.hero h1 { color: var(--white); margin-bottom: 16px; }
.hero .subheadline { color: rgba(255,255,255,0.85); font-size: 1.15rem; max-width: 560px; margin: 0 auto 32px; }
.hero .btn-primary { font-size: 1.2rem; padding: 16px 40px; }

/* Trust badges */
.trust-bar {
  display: flex;
  justify-content: center;
  gap: 32px;
  padding: 24px 20px;
  background: var(--gray-50);
  border-bottom: 1px solid var(--gray-200);
  flex-wrap: wrap;
}
.trust-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--navy);
}
.trust-badge .icon { font-size: 1.3rem; }

/* Feature grid */
.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 24px;
  padding: 48px 20px;
  max-width: var(--max-width);
  margin: 0 auto;
}
.feature-card {
  text-align: center;
  padding: 24px;
}
.feature-card .feature-icon { font-size: 2.5rem; margin-bottom: 12px; }
.feature-card h3 { margin-bottom: 8px; font-size: 1.1rem; }
.feature-card p { font-size: 0.9rem; color: var(--gray-600); }

/* Footer */
.landing-footer {
  text-align: center;
  padding: 32px 20px;
  color: var(--gray-400);
  font-size: 0.85rem;
  border-top: 1px solid var(--gray-200);
}

/* ==============================
   ASSESSMENT WIZARD
   ============================== */
.progress-container {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--white);
  padding: 16px 20px 8px;
  border-bottom: 1px solid var(--gray-200);
}
.progress-track {
  width: 100%;
  height: 6px;
  background: var(--gray-200);
  border-radius: 3px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: var(--gold);
  border-radius: 3px;
  transition: width 0.4s ease;
  width: 0%;
}
.progress-text {
  display: block;
  text-align: center;
  font-size: 0.85rem;
  color: var(--gray-400);
  margin-top: 6px;
  font-weight: 500;
}

/* Wizard content area */
.wizard-body {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 40px 20px 100px;
}
.category-header {
  text-align: center;
  margin-bottom: 32px;
}
.category-icon { font-size: 2.5rem; margin-bottom: 8px; }
.category-title { font-size: 1.5rem; color: var(--navy); }
.category-subtitle { color: var(--gray-400); font-size: 0.9rem; margin-top: 4px; }

.question-text {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 20px;
  line-height: 1.4;
}

/* Radio card options */
.options-list { display: flex; flex-direction: column; gap: 12px; }

.option-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 20px;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s ease;
  background: var(--white);
}
.option-card:hover { border-color: var(--gold-light); background: var(--gray-50); }
.option-card.selected { border-color: var(--gold); background: #FFFDF5; box-shadow: 0 0 0 1px var(--gold); }

.option-card input[type="radio"] { display: none; }

.option-radio {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border: 2px solid var(--gray-400);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
  transition: all 0.2s ease;
}
.option-card.selected .option-radio { border-color: var(--gold); }
.option-card.selected .option-radio::after {
  content: '';
  width: 12px;
  height: 12px;
  background: var(--gold);
  border-radius: 50%;
}
.option-label { font-size: 0.95rem; line-height: 1.4; color: var(--gray-600); }
.option-card.selected .option-label { color: var(--navy); font-weight: 500; }

/* Nav buttons */
.wizard-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--gray-200);
}

/* ==============================
   EMAIL GATE
   ============================== */
#email-gate {
  min-height: 100vh;
  display: none;
  align-items: center;
  justify-content: center;
  background: var(--gray-50);
  padding: 20px;
}
#email-gate.active { display: flex; }

.gate-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 48px 40px;
  max-width: 480px;
  width: 100%;
  text-align: center;
}
.gate-card h2 { margin-bottom: 8px; }
.gate-card .gate-subtitle { color: var(--gray-600); margin-bottom: 28px; }
.gate-card .score-preview {
  display: none;
}
.gate-card .score-preview-label {
  display: none;
}

.gate-form { display: flex; flex-direction: column; gap: 12px; text-align: left; }
.gate-form label { font-size: 0.85rem; font-weight: 600; color: var(--navy); }
.gate-form input {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--gray-200);
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
  transition: border-color var(--transition);
}
.gate-form input:focus { outline: none; border-color: var(--gold); }
.gate-form input.error { border-color: var(--red); }
.field-error { color: var(--red); font-size: 0.8rem; display: none; }
.gate-form .btn-primary { width: 100%; margin-top: 8px; }

.privacy-note {
  font-size: 0.8rem;
  color: var(--gray-400);
  margin-top: 16px;
}

/* ==============================
   RESULTS DASHBOARD
   ============================== */
.results-wrapper {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 40px 20px 60px;
}

/* Score header */
.results-header { text-align: center; margin-bottom: 40px; }
.results-header h2 { margin-bottom: 24px; }

.score-circle-container { position: relative; width: 180px; height: 180px; margin: 0 auto 16px; }
.score-circle {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  position: relative;
}
.score-circle svg { position: absolute; top: 0; left: 0; transform: rotate(-90deg); }
.score-circle .score-number { font-size: 3rem; font-weight: 700; color: var(--navy); z-index: 1; line-height: 1; }
.score-circle .score-total { font-size: 0.9rem; color: var(--gray-400); z-index: 1; }

.tier-badge {
  display: inline-block;
  padding: 8px 24px;
  border-radius: 100px;
  font-weight: 700;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.tier-badge.red { background: var(--red-bg); color: var(--red); }
.tier-badge.yellow { background: var(--yellow-bg); color: var(--gold-dark); }
.tier-badge.green { background: var(--green-bg); color: var(--green); }

/* Category breakdown */
.breakdown-section { margin-bottom: 40px; }
.breakdown-section h3 { margin-bottom: 20px; }

.category-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--gray-100);
}
.category-row:last-child { border-bottom: none; }
.cat-name { flex: 0 0 200px; font-size: 0.9rem; font-weight: 500; color: var(--navy); }
.cat-bar-track {
  flex: 1;
  height: 12px;
  background: var(--gray-100);
  border-radius: 6px;
  overflow: hidden;
}
.cat-bar-fill {
  height: 100%;
  border-radius: 6px;
  transition: width 1s ease;
  width: 0%;
}
.cat-bar-fill.level-low { background: var(--red); }
.cat-bar-fill.level-mid { background: var(--gold); }
.cat-bar-fill.level-high { background: var(--green); }
.cat-score {
  flex: 0 0 40px;
  text-align: right;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--navy);
}

/* Tier report */
.tier-report {
  background: var(--gray-50);
  border-radius: var(--radius);
  padding: 32px;
  margin-bottom: 40px;
}
.tier-report h3 { margin-bottom: 16px; }
.tier-report p { margin-bottom: 12px; font-size: 0.95rem; line-height: 1.7; }
.tier-report p:last-child { margin-bottom: 0; }

/* CTA section */
.cta-section {
  text-align: center;
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%);
  color: var(--white);
  border-radius: var(--radius);
  padding: 40px 32px;
  margin-bottom: 24px;
}
.cta-section h3 { color: var(--white); margin-bottom: 12px; font-size: 1.4rem; }
.cta-section p { color: rgba(255,255,255,0.85); margin-bottom: 24px; }

.results-actions { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; }

/* ==============================
   BANKER PAGE
   ============================== */
.banker-hero {
  text-align: center;
  padding: 80px 20px 48px;
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%);
  color: var(--white);
}
.banker-hero h1 { color: var(--white); margin-bottom: 16px; }
.banker-hero .subheadline { color: rgba(255,255,255,0.85); font-size: 1.1rem; max-width: 580px; margin: 0 auto 32px; line-height: 1.6; }
.banker-hero .btn-group { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

.banker-section {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 48px 20px;
}
.banker-section h2 { text-align: center; margin-bottom: 32px; }

.how-it-works {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 24px;
  margin-bottom: 48px;
}
.step-card {
  text-align: center;
  padding: 24px 16px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
}
.step-number {
  width: 40px;
  height: 40px;
  background: var(--gold);
  color: var(--navy);
  font-weight: 700;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}
.step-card h3 { font-size: 1rem; margin-bottom: 8px; }
.step-card p { font-size: 0.85rem; }

.banker-cta-card {
  background: var(--gray-50);
  border-radius: var(--radius);
  padding: 40px;
  text-align: center;
}
.banker-cta-card h3 { margin-bottom: 8px; }
.banker-cta-card p { margin-bottom: 24px; }

.copy-link-box {
  display: flex;
  gap: 8px;
  max-width: 480px;
  margin: 0 auto 16px;
}
.copy-link-box input {
  flex: 1;
  padding: 12px 16px;
  border: 2px solid var(--gray-200);
  border-radius: 8px;
  font-size: 0.9rem;
  font-family: inherit;
  background: var(--white);
}
.copy-link-box button { white-space: nowrap; }

.copied-toast {
  color: var(--green);
  font-size: 0.85rem;
  font-weight: 600;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.copied-toast.show { opacity: 1; }

/* Banker email form */
.banker-form {
  max-width: 400px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-align: left;
}
.banker-form label { font-size: 0.85rem; font-weight: 600; color: var(--navy); }
.banker-form input {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--gray-200);
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
}
.banker-form input:focus { outline: none; border-color: var(--gold); }

/* ==============================
   RESPONSIVE
   ============================== */
@media (max-width: 768px) {
  .hero { padding: 60px 20px 32px; }
  .trust-bar { gap: 16px; }
  .wizard-body { padding: 24px 16px 80px; }
  .cat-name { flex: 0 0 120px; font-size: 0.8rem; }
  .gate-card { padding: 32px 24px; }
  .tier-report { padding: 24px 20px; }
  .cta-section { padding: 32px 20px; }
  .banker-hero { padding: 60px 20px 40px; }
}

@media (max-width: 480px) {
  .trust-bar { flex-direction: column; gap: 8px; align-items: center; }
  .category-row { flex-wrap: wrap; }
  .cat-name { flex: 1 1 100%; }
  .copy-link-box { flex-direction: column; }
}

/* ==============================
   PRINT STYLES
   ============================== */
@media print {
  body { color: #000; }
  .hero, .trust-bar, .features, .landing-footer, .progress-container,
  .wizard-nav, #email-gate, .cta-section, .results-actions, .btn-primary,
  .btn-secondary, .btn-nav, #landing, #assessment { display: none !important; }
  .screen { display: block !important; opacity: 1 !important; }
  #results { display: block !important; opacity: 1 !important; }
  .results-wrapper { padding: 0; }
  .tier-report { break-inside: avoid; background: #f5f5f5 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .cat-bar-fill { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .tier-badge { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
