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

:root {
  --ink: #1a1a2e;
  --muted: #6b7280;
  --accent: #7c3aed;
  --accent-hover: #6d28d9;
  --accent-light: #ede9fe;
  --gold: #d97706;
  --gold-light: #fef3c7;
  --surface: #fafaf9;
  --border: #e5e7eb;
  --white: #ffffff;
  --red: #ef4444;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow-lg: 0 10px 40px rgba(0,0,0,.08);
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-serif: 'Playfair Display', Georgia, 'Times New Roman', serif;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--white);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ─── Nav ─────────────────────────────────────────── */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  max-width: 1100px; margin: 0 auto;
  padding: 16px 24px;
}
.logo {
  font-family: var(--font-serif);
  font-size: 20px; font-weight: 700;
  color: var(--accent); text-decoration: none;
}

/* ─── Hero ────────────────────────────────────────── */
.hero {
  padding: 60px 24px 80px;
  background: linear-gradient(180deg, #faf5ff 0%, var(--white) 100%);
}
.hero-inner {
  max-width: 1100px; margin: 0 auto;
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 48px; align-items: start;
}
.hero-text h1 {
  font-family: var(--font-serif);
  font-size: 42px; font-weight: 700;
  line-height: 1.2; color: var(--ink);
  margin-bottom: 16px;
}
.hero-sub {
  font-size: 17px; color: var(--muted);
  line-height: 1.7; max-width: 460px;
}

/* ─── Calculator Card ─────────────────────────────── */
.calc-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow-lg);
}
.calc-card .field {
  margin-bottom: 20px;
}
.calc-card label {
  display: block; font-size: 13px;
  font-weight: 600; color: var(--ink);
  margin-bottom: 6px; text-transform: uppercase;
  letter-spacing: 0.04em;
}
.calc-card .optional {
  font-weight: 400; color: var(--muted);
  text-transform: none; letter-spacing: 0;
}
.calc-card input[type="text"],
.calc-card input[type="date"],
.calc-card input[type="time"] {
  width: 100%; padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 8px; font-size: 15px;
  font-family: var(--font-sans);
  transition: border-color .15s;
  background: var(--surface);
}
.calc-card input:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}
.calc-card small {
  display: block; font-size: 12px;
  color: var(--muted); margin-top: 4px;
}
.field-row {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.btn-primary {
  width: 100%; padding: 14px 24px;
  background: var(--accent); color: var(--white);
  border: none; border-radius: 8px;
  font-size: 16px; font-weight: 600;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: background .15s, transform .1s;
}
.btn-primary:hover { background: var(--accent-hover); }
.btn-primary:active { transform: scale(.98); }

/* ─── Results ─────────────────────────────────────── */
.results {
  padding: 60px 24px 80px;
  background: var(--surface);
}
.results-inner {
  max-width: 1100px; margin: 0 auto;
}
.results h2 {
  font-family: var(--font-serif);
  font-size: 32px; text-align: center;
  margin-bottom: 8px;
}
.section-sub {
  text-align: center; color: var(--muted);
  font-size: 15px; margin-bottom: 40px;
}

/* Number Grid */
.number-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px; margin-bottom: 48px;
}
.number-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 16px; text-align: center;
  transition: box-shadow .2s;
}
.number-card:hover {
  box-shadow: var(--shadow-lg);
}
.nc-label {
  font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .06em;
  color: var(--muted); margin-bottom: 8px;
}
.nc-number {
  font-family: var(--font-serif);
  font-size: 48px; color: var(--accent);
  line-height: 1; margin-bottom: 8px;
}
.nc-number.master {
  color: var(--gold);
}
.nc-desc {
  font-size: 13px; color: var(--muted);
  line-height: 1.5;
}
.nc-badge {
  display: inline-block; margin-top: 8px;
  padding: 2px 10px;
  background: var(--gold-light); color: var(--gold);
  border-radius: 20px; font-size: 11px;
  font-weight: 600;
}

/* ─── Upgrade Card ────────────────────────────────── */
.upgrade-card {
  max-width: 640px; margin: 0 auto;
  background: var(--white);
  border: 2px solid var(--accent);
  border-radius: var(--radius);
  padding: 40px; text-align: center;
  box-shadow: 0 0 0 8px var(--accent-light);
  position: relative;
}
.upgrade-badge {
  position: absolute; top: -14px; left: 50%;
  transform: translateX(-50%);
  background: var(--accent); color: var(--white);
  padding: 4px 16px; border-radius: 20px;
  font-size: 12px; font-weight: 700;
}
.upgrade-card h3 {
  font-family: var(--font-serif);
  font-size: 24px; margin-bottom: 12px;
}
.upgrade-card p {
  color: var(--muted); font-size: 14px;
  line-height: 1.7; margin-bottom: 20px;
}
.upgrade-features {
  list-style: none; text-align: left;
  max-width: 400px; margin: 0 auto 24px;
}
.upgrade-features li {
  padding: 6px 0; font-size: 14px;
  color: var(--ink);
}
.upgrade-price {
  margin-bottom: 20px;
}
.price {
  font-family: var(--font-serif);
  font-size: 40px; font-weight: 700;
  color: var(--accent);
}
.price-note {
  display: block; font-size: 13px;
  color: var(--muted);
}
.btn-lg {
  padding: 16px 32px; font-size: 18px;
}
.guarantee {
  font-size: 12px; color: var(--muted);
  margin-top: 12px;
}

/* ─── Overlay ─────────────────────────────────────── */
.overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,.5);
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(4px);
}
.overlay-content {
  text-align: center; color: var(--white);
}
.overlay-content p {
  font-size: 18px; margin-top: 20px;
}
.overlay-content small {
  color: rgba(255,255,255,.7); font-size: 13px;
}
.spinner {
  width: 48px; height: 48px;
  border: 4px solid rgba(255,255,255,.3);
  border-top-color: var(--white);
  border-radius: 50%;
  animation: spin .8s linear infinite;
  margin: 0 auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Report Viewer */
.report-viewer {
  width: 100%; height: 100%;
  background: var(--white);
  display: flex; flex-direction: column;
}
.report-toolbar {
  display: flex; justify-content: space-between;
  padding: 12px 20px; border-bottom: 1px solid var(--border);
  background: var(--surface); gap: 12px;
}
.report-toolbar .btn-primary {
  width: auto; padding: 8px 20px; font-size: 14px;
}
.btn-secondary {
  padding: 8px 20px; font-size: 14px;
  background: var(--white); color: var(--ink);
  border: 1px solid var(--border);
  border-radius: 8px; cursor: pointer;
  font-family: var(--font-sans);
}
.btn-secondary:hover { background: var(--surface); }

/* ─── Footer ──────────────────────────────────────── */
.footer {
  text-align: center; padding: 40px 24px;
  color: var(--muted); font-size: 12px;
  border-top: 1px solid var(--border);
}

/* ─── Responsive ──────────────────────────────────── */
@media (max-width: 768px) {
  .hero-inner {
    grid-template-columns: 1fr; gap: 32px;
  }
  .hero-text h1 {
    font-size: 30px;
  }
  .number-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .field-row {
    grid-template-columns: 1fr;
  }
  .calc-card {
    padding: 20px;
  }
  .upgrade-card {
    padding: 24px;
  }
}
