/* ============================================================
   Rent vs Buy Calculator — style.css
   Aesthetic: Financial precision with warm Australian feel
   Palette: Deep navy + gold accent + clean white panels
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=DM+Serif+Display:ital@0;1&family=DM+Sans:wght@300;400;500;600;700&display=swap');

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

:root {
  --navy:       #0f2545;
  --navy-mid:   #1e3a5f;
  --blue:       #2563eb;
  --blue-light: #eff6ff;
  --gold:       #f59e0b;
  --gold-light: #fffbeb;
  --green:      #16a34a;
  --green-light:#f0fdf4;
  --red:        #dc2626;
  --red-light:  #fef2f2;
  --gray-50:    #f9fafb;
  --gray-100:   #f3f4f6;
  --gray-200:   #e5e7eb;
  --gray-400:   #9ca3af;
  --gray-500:   #6b7280;
  --gray-700:   #374151;
  --gray-900:   #111827;
  --white:      #ffffff;

  --radius-sm:  6px;
  --radius:     10px;
  --radius-lg:  16px;
  --radius-xl:  24px;

  --shadow-sm:  0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
  --shadow:     0 4px 16px rgba(15,37,69,.12);
  --shadow-lg:  0 12px 40px rgba(15,37,69,.18);

  --transition: 180ms ease;
  --font-body:  'DM Sans', sans-serif;
  --font-head:  'DM Serif Display', serif;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--gray-50);
  color: var(--gray-900);
  line-height: 1.6;
  min-height: 100vh;
}

/* ── Hero header ─────────────────────────────────────────────── */
.hero {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-mid) 55%, #1d4ed8 100%);
  padding: 56px 24px 64px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 80% at 20% 50%, rgba(37,99,235,.25) 0%, transparent 60%),
    radial-gradient(ellipse 40% 60% at 80% 20%, rgba(245,158,11,.12) 0%, transparent 50%);
  pointer-events: none;
}

.hero-inner { position: relative; max-width: 720px; margin: 0 auto; }

.hero-badge {
  display: inline-block;
  background: rgba(245,158,11,.18);
  border: 1px solid rgba(245,158,11,.4);
  color: #fcd34d;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  padding: 5px 14px;
  border-radius: 99px;
  margin-bottom: 18px;
}

.hero h1 {
  font-family: var(--font-head);
  font-size: clamp(2rem, 5vw, 3.2rem);
  color: var(--white);
  line-height: 1.15;
  margin-bottom: 14px;
}

.hero h1 em {
  font-style: italic;
  color: #fcd34d;
}

.hero p {
  color: #bfdbfe;
  font-size: 1rem;
  max-width: 500px;
  margin: 0 auto;
}

/* ── Main layout ─────────────────────────────────────────────── */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
}

.calc-layout {
  display: grid;
  grid-template-columns: 400px 1fr;
  gap: 28px;
  padding: 36px 0 60px;
  align-items: start;
}

@media (max-width: 860px) {
  .calc-layout { grid-template-columns: 1fr; }
}

/* ── Cards ───────────────────────────────────────────────────── */
.card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.card-header {
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--gray-100);
  display: flex;
  align-items: center;
  gap: 10px;
}

.card-header-icon {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.card-header-icon.navy { background: var(--navy); color: var(--white); }
.card-header-icon.blue { background: var(--blue-light); color: var(--blue); }
.card-header-icon.gold { background: var(--gold-light); color: var(--gold); }

.card-header h2 {
  font-size: 15px;
  font-weight: 600;
  color: var(--navy);
  letter-spacing: -.2px;
}

.card-body { padding: 20px 24px; }

/* ── Input panel ─────────────────────────────────────────────── */
.input-panel { position: sticky; top: 24px; }

.section-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--gray-400);
  margin: 20px 0 12px;
}

.section-label:first-child { margin-top: 0; }

.input-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.input-grid.single { grid-template-columns: 1fr; }

.field { display: flex; flex-direction: column; gap: 5px; }

.field label {
  font-size: 12px;
  font-weight: 500;
  color: var(--gray-500);
}

.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.input-prefix, .input-suffix {
  position: absolute;
  font-size: 13px;
  font-weight: 500;
  color: var(--gray-400);
  pointer-events: none;
  line-height: 1;
}

.input-prefix { left: 10px; }
.input-suffix { right: 10px; }

.field input {
  width: 100%;
  height: 38px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  color: var(--gray-900);
  background: var(--white);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
  padding: 0 10px;
}

.field input.has-prefix { padding-left: 22px; }
.field input.has-suffix { padding-right: 30px; }

.field input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}

.field input:hover:not(:focus) { border-color: var(--gray-400); }

/* ── Calculate button ────────────────────────────────────────── */
.btn-calc {
  width: 100%;
  height: 48px;
  margin-top: 20px;
  background: linear-gradient(135deg, var(--navy) 0%, var(--blue) 100%);
  color: var(--white);
  border: none;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .3px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: opacity var(--transition), transform var(--transition), box-shadow var(--transition);
  box-shadow: 0 4px 14px rgba(37,99,235,.35);
}

.btn-calc:hover {
  opacity: .92;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(37,99,235,.4);
}

.btn-calc:active { transform: translateY(0); }

/* ── Results panel ───────────────────────────────────────────── */
.results-panel { display: flex; flex-direction: column; gap: 20px; }

/* Verdict banner */
.verdict-card {
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
  animation: fadeSlideUp .45s ease both;
}

.verdict-buying { background: linear-gradient(135deg, #064e3b 0%, #16a34a 100%); }
.verdict-renting { background: linear-gradient(135deg, #7f1d1d 0%, #dc2626 100%); }

.verdict-inner { padding: 28px 32px; color: var(--white); }

.verdict-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  opacity: .75;
  margin-bottom: 8px;
}

.verdict-title {
  font-family: var(--font-head);
  font-size: clamp(1.4rem, 3vw, 2rem);
  line-height: 1.2;
  margin-bottom: 6px;
}

.verdict-subtitle { font-size: 14px; opacity: .8; }

/* Wealth comparison */
.wealth-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

@media (max-width: 560px) { .wealth-grid { grid-template-columns: 1fr; } }

.wealth-card {
  border-radius: var(--radius);
  padding: 20px;
  animation: fadeSlideUp .5s ease both;
}

.wealth-card.buyer { background: var(--blue-light); border: 1.5px solid #bfdbfe; }
.wealth-card.renter { background: var(--green-light); border: 1.5px solid #bbf7d0; }

.wealth-card-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.wealth-card.buyer .wealth-card-label { color: var(--blue); }
.wealth-card.renter .wealth-card-label { color: var(--green); }

.wealth-amount {
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 4px;
}

.wealth-card.buyer .wealth-amount { color: var(--navy); }
.wealth-card.renter .wealth-amount { color: #14532d; }

.wealth-desc { font-size: 12px; color: var(--gray-500); }

/* Key metrics strip */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  animation: fadeSlideUp .55s ease both;
}

@media (max-width: 560px) { .metrics-grid { grid-template-columns: 1fr 1fr; } }

.metric-item {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
}

.metric-label { font-size: 11px; color: var(--gray-500); font-weight: 500; margin-bottom: 5px; }
.metric-value { font-size: 1.15rem; font-weight: 700; color: var(--navy); }
.metric-sub   { font-size: 11px; color: var(--gray-400); margin-top: 2px; }

/* ── Chart card ──────────────────────────────────────────────── */
.chart-card { animation: fadeSlideUp .6s ease both; }

.chart-tabs {
  display: flex;
  gap: 6px;
  padding: 16px 24px 0;
}

.chart-tab {
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: 1.5px solid transparent;
  background: transparent;
  color: var(--gray-500);
  font-family: var(--font-body);
  transition: all var(--transition);
}

.chart-tab.active {
  background: var(--navy);
  color: var(--white);
  border-color: var(--navy);
}

.chart-tab:not(.active):hover {
  border-color: var(--gray-200);
  background: var(--gray-50);
  color: var(--gray-700);
}

.chart-wrap { padding: 16px 24px 20px; position: relative; height: 280px; }

/* ── Year-by-year table ──────────────────────────────────────── */
.table-card { animation: fadeSlideUp .65s ease both; }

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.data-table thead tr { background: var(--navy); }
.data-table thead th {
  padding: 10px 14px;
  color: var(--white);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: .5px;
  text-transform: uppercase;
  text-align: right;
}

.data-table thead th:first-child { text-align: center; border-radius: var(--radius-sm) 0 0 0; }
.data-table thead th:last-child  { border-radius: 0 var(--radius-sm) 0 0; }

.data-table tbody tr {
  border-bottom: 1px solid var(--gray-100);
  transition: background var(--transition);
}

.data-table tbody tr:hover { background: var(--gray-50); }

.data-table tbody td {
  padding: 9px 14px;
  text-align: right;
  color: var(--gray-700);
  font-variant-numeric: tabular-nums;
}

.data-table tbody td:first-child {
  text-align: center;
  font-weight: 700;
  color: var(--navy);
}

.data-table tbody tr.highlight-row td { font-weight: 700; color: var(--navy); }
.data-table tbody tr.breakeven-row td { background: #fefce8; }
.data-table tbody tr.breakeven-row td:first-child::after {
  content: ' ★';
  color: var(--gold);
  font-size: 11px;
}

/* ── Email capture card ──────────────────────────────────────── */
.email-card { animation: fadeSlideUp .7s ease both; }

.email-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

@media (max-width: 560px) { .email-form-grid { grid-template-columns: 1fr; } }

.email-field { display: flex; flex-direction: column; gap: 5px; }

.email-field label { font-size: 12px; font-weight: 500; color: var(--gray-500); }

.email-field input {
  height: 40px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--gray-900);
  padding: 0 12px;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.email-field input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}

.turnstile-wrap { margin: 14px 0; }

.btn-email {
  width: 100%;
  height: 44px;
  background: var(--navy);
  color: var(--white);
  border: none;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background var(--transition), transform var(--transition);
}

.btn-email:hover { background: var(--blue); transform: translateY(-1px); }
.btn-email:disabled { background: var(--gray-400); cursor: not-allowed; transform: none; }

.form-msg {
  margin-top: 12px;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  display: none;
}

.form-msg.success { background: var(--green-light); color: #14532d; border: 1px solid #bbf7d0; }
.form-msg.error   { background: var(--red-light);   color: #7f1d1d; border: 1px solid #fecaca; }

/* ── Placeholder / empty state ───────────────────────────────── */
.results-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 64px 24px;
  text-align: center;
  background: var(--white);
  border: 2px dashed var(--gray-200);
  border-radius: var(--radius-lg);
  color: var(--gray-400);
  gap: 12px;
}

.results-placeholder svg { opacity: .35; }
.results-placeholder p { font-size: 14px; max-width: 240px; }

/* ── Disclaimer ──────────────────────────────────────────────── */
.disclaimer {
  margin-top: 4px;
  padding: 12px 16px;
  background: var(--gold-light);
  border: 1px solid #fde68a;
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: #78350f;
  line-height: 1.5;
}

/* ── Animations ──────────────────────────────────────────────── */
@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Scrollbar ───────────────────────────────────────────────── */
.table-scroll { overflow-x: auto; }

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--gray-200); border-radius: 99px; }

/* ── Footer ──────────────────────────────────────────────────── */
.site-footer {
  background: var(--navy);
  color: #64748b;
  text-align: center;
  padding: 22px 24px;
  font-size: 12px;
}

.site-footer a { color: #94a3b8; text-decoration: none; }

/* ── Responsive tweaks ───────────────────────────────────────── */
@media (max-width: 560px) {
  .hero { padding: 40px 20px 48px; }
  .card-body { padding: 16px; }
  .verdict-inner { padding: 22px 20px; }
  .metrics-grid { grid-template-columns: 1fr 1fr; }
}
