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

:root {
  --gold:       #C9A84C;
  --gold-light: #E8C96A;
  --gold-dark:  #A07830;
  --navy:       #0D1F33;
  --navy-mid:   #162A45;
  --navy-light: #1E3A5F;
  --white:      #FFFFFF;
  --off-white:  #F8F6F2;
  --grey-light: #F0EDE8;
  --grey-mid:   #C8C4BC;
  --grey-text:  #7A8A9A;
  --body-text:  #2C3E50;
  --success:    #1A7A4A;
  --shadow-sm:  0 2px 8px rgba(0,0,0,0.08);
  --shadow-md:  0 4px 20px rgba(0,0,0,0.12);
  --shadow-lg:  0 8px 40px rgba(0,0,0,0.18);
  --radius:     12px;
  --radius-sm:  8px;
  --transition: all 0.25s ease;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  color: var(--body-text);
  background: var(--off-white);
  min-height: 100vh;
}

.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.hidden { display: none !important; }
.gold { color: var(--gold); }

/* ── Header ─────────────────────────────────────────────────────────────────── */
.site-header {
  background: var(--navy);
  border-bottom: 2px solid var(--gold);
  position: sticky; top: 0; z-index: 100;
  box-shadow: var(--shadow-md);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 0;
}
.brand { display: flex; flex-direction: column; }
.brand-name {
  font-family: 'Playfair Display', serif;
  font-size: 20px; font-weight: 700;
  color: var(--white); letter-spacing: 0.5px;
}
.brand-sub {
  font-size: 11px; color: var(--gold);
  letter-spacing: 1.5px; text-transform: uppercase;
}
.header-nav { display: flex; gap: 12px; align-items: center; }

/* ── Buttons ─────────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 10px 20px; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 600; cursor: pointer;
  border: none; text-decoration: none;
  transition: var(--transition); white-space: nowrap;
}
.btn-gold {
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-light) 50%, var(--gold) 100%);
  color: var(--navy); letter-spacing: 0.3px;
}
.btn-gold:hover { transform: translateY(-1px); box-shadow: 0 4px 16px rgba(201,168,76,0.4); }
.btn-ghost {
  background: transparent; color: var(--grey-mid);
  border: 1px solid rgba(255,255,255,0.15);
  font-size: 13px;
}
.btn-ghost:hover { color: var(--white); border-color: rgba(255,255,255,0.3); }
.btn-full { width: 100%; }
.btn-large { padding: 16px 28px; font-size: 16px; border-radius: var(--radius); }

/* ── Hero ────────────────────────────────────────────────────────────────────── */
.hero {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-mid) 60%, #1A2E45 100%);
  padding: 56px 0 48px;
  position: relative; overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  background: radial-gradient(ellipse at 70% 50%, rgba(201,168,76,0.06) 0%, transparent 70%);
  pointer-events: none;
}
.hero-badge {
  display: inline-block;
  background: rgba(201,168,76,0.15);
  border: 1px solid rgba(201,168,76,0.3);
  color: var(--gold); font-size: 11px; font-weight: 600;
  letter-spacing: 1.5px; padding: 6px 14px; border-radius: 20px;
  margin-bottom: 20px; text-transform: uppercase;
}
.hero-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(36px, 5vw, 56px);
  font-weight: 700; color: var(--white);
  line-height: 1.15; margin-bottom: 16px;
}
.hero-sub {
  font-size: 16px; color: rgba(255,255,255,0.7);
  max-width: 620px; margin-bottom: 36px; line-height: 1.7;
}

/* Mode toggle */
.mode-toggle { display: flex; gap: 12px; flex-wrap: wrap; }
.mode-btn {
  display: flex; flex-direction: column; align-items: flex-start;
  padding: 16px 22px; border-radius: var(--radius);
  background: rgba(255,255,255,0.06);
  border: 1.5px solid rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.7);
  cursor: pointer; transition: var(--transition);
  min-width: 180px; text-align: left;
}
.mode-btn:hover { border-color: rgba(201,168,76,0.4); color: var(--white); }
.mode-btn.active {
  background: rgba(201,168,76,0.12);
  border-color: var(--gold); color: var(--white);
}
.mode-icon { font-size: 20px; margin-bottom: 4px; }
.mode-btn span:not(.mode-icon):not(.mode-desc) { font-size: 15px; font-weight: 600; }
.mode-desc { font-size: 12px; color: var(--grey-text); margin-top: 2px; }

/* ── Main calculator grid ────────────────────────────────────────────────────── */
.calc-main { padding: 40px 0 80px; }
.calc-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px; align-items: start;
}
@media (max-width: 900px) {
  .calc-grid { grid-template-columns: 1fr; }
}

/* ── Input panel ─────────────────────────────────────────────────────────────── */
.input-panel { display: flex; flex-direction: column; gap: 16px; }

.input-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 28px; box-shadow: var(--shadow-sm);
  border: 1px solid rgba(0,0,0,0.06);
}
.card-header { margin-bottom: 24px; }
.card-header h2 {
  font-family: 'Playfair Display', serif;
  font-size: 20px; color: var(--navy); margin-bottom: 6px;
}
.card-header p { font-size: 14px; color: var(--grey-text); line-height: 1.6; }

.field-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field-label { font-size: 13px; font-weight: 600; color: var(--navy); letter-spacing: 0.2px; }
.req { color: var(--gold); }
.field-hint { font-size: 12px; color: var(--gold-dark); font-style: italic; min-height: 16px; }

.field-input, .field-select, .field-textarea {
  width: 100%; padding: 11px 14px;
  border: 1.5px solid #E0DCd6;
  border-radius: var(--radius-sm);
  font-size: 14px; font-family: 'Inter', sans-serif;
  color: var(--navy); background: var(--white);
  transition: var(--transition); outline: none;
}
.field-input:focus, .field-select:focus, .field-textarea:focus {
  border-color: var(--gold); box-shadow: 0 0 0 3px rgba(201,168,76,0.12);
}
.field-textarea { resize: vertical; min-height: 120px; }

.input-prefix { position: relative; }
.prefix {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  font-size: 14px; color: var(--grey-text); font-weight: 600; pointer-events: none;
}
.prefix-input { padding-left: 26px; }

.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 480px) { .field-row { grid-template-columns: 1fr; } }

.divider-label {
  font-size: 11px; font-weight: 700; letter-spacing: 1.5px;
  text-transform: uppercase; color: var(--grey-text);
  margin: 8px 0 16px; padding-top: 16px;
  border-top: 1px solid var(--grey-light);
}

/* Slider */
.slider-wrap { display: flex; align-items: center; gap: 12px; }
.field-slider {
  flex: 1; -webkit-appearance: none; appearance: none;
  height: 4px; border-radius: 2px;
  background: linear-gradient(to right, var(--gold) 0%, var(--gold) 68%, #E0DCd6 68%);
  outline: none; border: none; padding: 0;
}
.field-slider::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--gold); cursor: pointer;
  border: 2px solid var(--white);
  box-shadow: 0 2px 6px rgba(201,168,76,0.4);
}
.slider-val {
  font-size: 15px; font-weight: 700; color: var(--navy);
  min-width: 44px; text-align: right;
}

#calcButtonWrap { display: flex; flex-direction: column; gap: 8px; }
.calc-note { font-size: 12px; color: var(--grey-text); text-align: center; }
.ai-note { font-size: 12px; color: var(--grey-text); text-align: center; margin-top: 8px; }

/* ── Results panel ───────────────────────────────────────────────────────────── */
.results-panel { position: sticky; top: 80px; }

.results-placeholder {
  background: var(--white); border-radius: var(--radius);
  padding: 48px 32px; text-align: center;
  border: 1.5px dashed #D8D4CE;
  box-shadow: var(--shadow-sm);
}
.placeholder-icon { font-size: 48px; margin-bottom: 16px; }
.results-placeholder h3 {
  font-family: 'Playfair Display', serif;
  font-size: 22px; color: var(--navy); margin-bottom: 10px;
}
.results-placeholder p { font-size: 14px; color: var(--grey-text); margin-bottom: 28px; }
.sample-stats { display: flex; flex-direction: column; gap: 10px; }
.sample-stat {
  display: flex; justify-content: space-between;
  padding: 10px 16px; background: var(--grey-light);
  border-radius: var(--radius-sm);
}
.sample-label { font-size: 13px; color: var(--grey-text); }
.sample-val { font-size: 14px; font-weight: 700; }

/* Metrics grid */
.metrics-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 12px; margin-bottom: 20px;
}
.metric-card {
  background: var(--white); border-radius: var(--radius);
  padding: 18px 20px; box-shadow: var(--shadow-sm);
  border: 1px solid rgba(0,0,0,0.06);
}
.metric-card.metric-primary {
  background: var(--navy);
  border-color: var(--gold);
  border-width: 1.5px;
}
.metric-primary .metric-label { color: rgba(255,255,255,0.6); }
.metric-primary .metric-val { color: var(--gold); }
.metric-primary .metric-sub { color: rgba(255,255,255,0.4); }
.metric-label { font-size: 12px; color: var(--grey-text); font-weight: 500; margin-bottom: 6px; }
.metric-val {
  font-family: 'Playfair Display', serif;
  font-size: 28px; font-weight: 700; color: var(--navy);
  line-height: 1;
}
.metric-sub { font-size: 11px; color: var(--grey-text); margin-top: 4px; }

/* Projection table */
.projection-card {
  background: var(--white); border-radius: var(--radius);
  padding: 24px; box-shadow: var(--shadow-sm);
  border: 1px solid rgba(0,0,0,0.06);
  margin-bottom: 20px;
}
.projection-title {
  font-family: 'Playfair Display', serif;
  font-size: 17px; color: var(--navy); margin-bottom: 16px;
}
.projection-table-wrap { overflow-x: auto; }
.projection-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.projection-table th {
  background: var(--navy); color: var(--gold);
  padding: 10px 12px; text-align: left;
  font-size: 11px; letter-spacing: 0.5px; font-weight: 600;
}
.projection-table td { padding: 10px 12px; border-bottom: 1px solid var(--grey-light); }
.projection-table tr:last-child td { border-bottom: none; }
.projection-table tr:nth-child(even) td { background: var(--off-white); }
.projection-table tr:hover td { background: rgba(201,168,76,0.06); }

/* AI commentary */
.ai-commentary-card {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-mid) 100%);
  border-radius: var(--radius); padding: 24px;
  border: 1.5px solid rgba(201,168,76,0.25);
  margin-bottom: 20px;
}
.ai-header { margin-bottom: 16px; }
.ai-badge {
  display: inline-block;
  background: rgba(201,168,76,0.15);
  border: 1px solid rgba(201,168,76,0.3);
  color: var(--gold); font-size: 11px; font-weight: 600;
  letter-spacing: 1.5px; padding: 5px 12px; border-radius: 20px;
  text-transform: uppercase;
}
.ai-text {
  font-size: 14px; color: rgba(255,255,255,0.85);
  line-height: 1.8;
}
.ai-text p { margin-bottom: 12px; }
.ai-text p:last-child { margin-bottom: 0; }

/* Loading dots */
.ai-loading { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 16px 0; }
.ai-loading p { color: rgba(255,255,255,0.5); font-size: 13px; }
.loading-dots { display: flex; gap: 6px; }
.loading-dots span {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--gold); opacity: 0.3;
  animation: dotPulse 1.4s ease-in-out infinite;
}
.loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.loading-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes dotPulse {
  0%, 80%, 100% { opacity: 0.3; transform: scale(0.8); }
  40% { opacity: 1; transform: scale(1); }
}

/* Lead gate */
.lead-gate {
  background: var(--white); border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  border: 2px solid var(--gold);
  overflow: hidden;
}
.gate-inner { padding: 28px; }
.gate-icon { font-size: 36px; margin-bottom: 12px; }
.lead-gate h3 {
  font-family: 'Playfair Display', serif;
  font-size: 20px; color: var(--navy); margin-bottom: 8px;
}
.lead-gate p { font-size: 14px; color: var(--grey-text); margin-bottom: 20px; line-height: 1.6; }
.gate-form { display: flex; flex-direction: column; gap: 10px; }
.gate-input {
  width: 100%; padding: 12px 14px;
  border: 1.5px solid #E0DCd6;
  border-radius: var(--radius-sm);
  font-size: 14px; font-family: 'Inter', sans-serif;
  color: var(--navy); outline: none; transition: var(--transition);
}
.gate-input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(201,168,76,0.12); }
.gate-privacy { font-size: 11px; color: var(--grey-text); text-align: center; }

/* Success state */
.lead-success {
  background: var(--white); border-radius: var(--radius);
  padding: 40px 28px; text-align: center;
  border: 2px solid var(--success);
}
.success-icon { font-size: 48px; margin-bottom: 16px; }
.lead-success h3 {
  font-family: 'Playfair Display', serif;
  font-size: 22px; color: var(--navy); margin-bottom: 10px;
}
.lead-success p { font-size: 14px; color: var(--grey-text); margin-bottom: 24px; line-height: 1.6; }

/* ── Footer ──────────────────────────────────────────────────────────────────── */
.site-footer {
  background: var(--navy);
  border-top: 2px solid var(--gold);
  padding: 32px 0;
}
.footer-inner {
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 16px; margin-bottom: 20px;
}
.footer-brand { display: flex; flex-direction: column; gap: 4px; }
.footer-brand .brand-name {
  font-family: 'Playfair Display', serif;
  font-size: 18px; font-weight: 700; color: var(--white);
}
.footer-desc { font-size: 12px; color: var(--gold); letter-spacing: 0.5px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 16px; }
.footer-links a {
  font-size: 13px; color: rgba(255,255,255,0.6);
  text-decoration: none; transition: var(--transition);
}
.footer-links a:hover { color: var(--gold); }
.footer-disclaimer {
  font-size: 11px; color: rgba(255,255,255,0.3);
  line-height: 1.6; border-top: 1px solid rgba(255,255,255,0.08);
  padding-top: 16px;
}

/* ── Responsive ──────────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .header-nav .btn-ghost { display: none; }
  .metrics-grid { grid-template-columns: 1fr; }
  .footer-inner { flex-direction: column; text-align: center; }
  .footer-links { justify-content: center; }
  .mode-toggle { flex-direction: column; }
  .mode-btn { min-width: unset; width: 100%; }
}
