/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', Arial, sans-serif;
  color: #1a1d23;
  background: #f8f9fb;
  line-height: 1.6;
}

/* ===== VARIABLES ===== */
:root {
  --navy: #0d1b2e;
  --navy-mid: #1a3251;
  --accent: #1d5fcc;
  --accent-light: #2970e8;
  --accent-pale: #e8f0fd;
  --gold: #c9a227;
  --success: #1a9e5f;
  --success-bg: #e6f8f1;
  --warning: #c9a227;
  --warning-bg: #fdf8e7;
  --danger: #d63031;
  --text-primary: #1a1d23;
  --text-secondary: #5a6175;
  --text-muted: #8a94a6;
  --border: #e2e6ee;
  --surface: #ffffff;
  --surface-alt: #f3f6fc;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 2px 12px rgba(13,27,46,0.08);
  --shadow-md: 0 4px 24px rgba(13,27,46,0.12);
  --shadow-lg: 0 8px 40px rgba(13,27,46,0.16);
}

/* ===== CONTAINER ===== */
.container { max-width: 1140px; margin: 0 auto; padding: 0 24px; }

/* ===== HEADER ===== */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  background: rgba(13, 27, 46, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  transition: background 0.3s;
}
.header-inner {
  max-width: 1140px; margin: 0 auto; padding: 0 24px;
  height: 68px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
}
.logo {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
  min-width: 0;
  overflow: hidden;
}
.logo-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 8px;
  background: var(--accent); color: #fff;
  font-family: 'Playfair Display', serif;
  font-size: 0.85rem; font-weight: 700;
  flex-shrink: 0;
}
.logo-mark.small { width: 28px; height: 28px; font-size: 0.75rem; }
.logo-text {
  font-family: 'Playfair Display', serif;
  font-size: 1.2rem; font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.main-nav {
  display: flex; align-items: center; gap: 8px;
  flex-shrink: 0;
}
.nav-link {
  color: rgba(255,255,255,0.75);
  text-decoration: none;
  font-size: 0.9rem; font-weight: 500;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  transition: color 0.2s, background 0.2s;
}
.nav-link:hover, .nav-link.active { color: #fff; background: rgba(255,255,255,0.1); }
.nav-auth { display: flex; align-items: center; gap: 8px; margin-left: 8px; }
.btn-login, .btn-logout {
  background: var(--accent); color: #fff;
  border: none; cursor: pointer;
  padding: 7px 18px; border-radius: var(--radius-sm);
  font-size: 0.875rem; font-weight: 500;
  font-family: 'Inter', Arial, sans-serif;
  transition: background 0.2s;
}
.btn-logout { background: rgba(255,255,255,0.15); }
.btn-login:hover { background: var(--accent-light); }
.btn-logout:hover { background: rgba(255,255,255,0.25); }
.user-area { display: flex; align-items: center; gap: 10px; }
.user-name { color: rgba(255,255,255,0.85); font-size: 0.875rem; font-weight: 500; }
.mobile-toggle {
  display: none; flex-direction: column; gap: 5px;
  background: none; border: none; cursor: pointer;
  padding: 4px; flex-shrink: 0;
}
.mobile-toggle span { display: block; width: 22px; height: 2px; background: #fff; border-radius: 2px; }

/* ===== HERO ===== */
.hero {
  position: relative; overflow: hidden;
  min-height: 580px;
  display: flex; align-items: center;
  padding-top: 68px;
}
.hero-bg {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
  z-index: 0;
}
.hero-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(10,22,40,0.88) 0%, rgba(13,27,46,0.75) 100%);
  z-index: 1;
  pointer-events: none;
}
.hero-content {
  position: relative; z-index: 2;
  max-width: 640px;
  padding: 80px 24px 80px 64px;
}
.hero-badge {
  display: inline-block;
  background: rgba(29,95,204,0.3);
  border: 1px solid rgba(29,95,204,0.5);
  color: #90b8ff;
  font-size: 0.78rem; font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase;
  padding: 5px 14px; border-radius: 20px;
  margin-bottom: 20px;
}
.hero h1 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
  margin-bottom: 18px;
}
.hero-sub {
  color: rgba(255,255,255,0.78);
  font-size: 1.05rem; line-height: 1.7;
  margin-bottom: 36px;
  max-width: 500px;
}
.btn-primary {
  display: inline-block;
  background: var(--accent); color: #fff;
  text-decoration: none;
  padding: 14px 32px; border-radius: 10px;
  font-weight: 600; font-size: 1rem;
  transition: background 0.2s, transform 0.15s;
  box-shadow: 0 4px 16px rgba(29,95,204,0.4);
}
.btn-primary:hover { background: var(--accent-light); transform: translateY(-1px); }

/* ===== HOW SECTION ===== */
.how-section { padding: 80px 0; background: var(--surface); }
.section-label {
  font-size: 0.78rem; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 10px;
}
.section-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 700; color: var(--navy);
  margin-bottom: 48px;
  line-height: 1.25;
}
.methods-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.method-card {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 28px;
  transition: box-shadow 0.2s, border-color 0.2s;
}
.method-card:hover { box-shadow: var(--shadow-md); border-color: #c0cfe8; }
.method-num {
  font-family: 'Playfair Display', serif;
  font-size: 2rem; font-weight: 700;
  color: var(--accent); opacity: 0.5;
  margin-bottom: 14px;
}
.method-card h3 { font-size: 1.05rem; font-weight: 700; color: var(--navy); margin-bottom: 10px; }
.method-card p { font-size: 0.9rem; color: var(--text-secondary); line-height: 1.65; }

/* ===== ESTIMATOR SECTION ===== */
.estimator-section { padding: 80px 0 100px; background: var(--surface-alt); }
.estimator-layout {
  display: grid; grid-template-columns: 440px 1fr;
  gap: 40px; align-items: start;
}
.form-panel {
  background: var(--surface);
  border-radius: 16px;
  border: 1px solid var(--border);
  padding: 40px;
  box-shadow: var(--shadow);
  position: sticky; top: 88px;
}
.form-note {
  font-size: 0.82rem; color: var(--text-muted);
  display: flex; align-items: center; gap: 6px;
  margin-bottom: 32px;
  padding: 8px 12px;
  background: #f0f4fb;
  border-radius: 6px;
}
.form-note::before { content: "🔒"; font-size: 0.85rem; }
.valuation-form .section-title { margin-bottom: 4px; }

.form-group { margin-bottom: 22px; }
.form-group label {
  display: block; font-size: 0.875rem; font-weight: 600;
  color: var(--text-primary); margin-bottom: 8px;
}
.input-wrap {
  display: flex; align-items: center;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  transition: border-color 0.2s, box-shadow 0.2s;
  overflow: hidden;
}
.input-wrap:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(29,95,204,0.12);
}
.input-prefix, .input-suffix {
  padding: 0 12px;
  font-size: 0.95rem; font-weight: 500;
  color: var(--text-muted);
  background: var(--surface-alt);
  border-right: 1.5px solid var(--border);
  height: 46px; display: flex; align-items: center;
}
.input-suffix { border-right: none; border-left: 1.5px solid var(--border); }
.input-wrap input, .input-wrap select {
  flex: 1; border: none; outline: none;
  padding: 12px 14px;
  font-size: 0.95rem; color: var(--text-primary);
  background: transparent;
  font-family: 'Inter', Arial, sans-serif;
  height: 46px;
}
.select-wrap { position: relative; }
.input-wrap select { cursor: pointer; appearance: none; padding-right: 36px; }
.select-wrap::after {
  content: '▾'; position: absolute; right: 14px;
  top: 50%; transform: translateY(-50%);
  color: var(--text-muted); pointer-events: none;
  font-size: 0.85rem;
}
.field-hint { font-size: 0.78rem; color: var(--text-muted); margin-top: 5px; display: block; }

.form-error {
  background: #fee2e2; color: #b91c1c;
  border-radius: 8px; padding: 10px 14px;
  font-size: 0.875rem; margin-bottom: 16px;
}

.btn-calculate {
  width: 100%; padding: 15px;
  background: var(--accent); color: #fff;
  border: none; border-radius: 10px; cursor: pointer;
  font-size: 1rem; font-weight: 600;
  font-family: 'Inter', Arial, sans-serif;
  transition: background 0.2s, transform 0.15s;
  box-shadow: 0 4px 16px rgba(29,95,204,0.3);
  margin-top: 6px;
}
.btn-calculate:hover:not(:disabled) { background: var(--accent-light); transform: translateY(-1px); }
.btn-calculate:disabled { opacity: 0.7; cursor: not-allowed; }

.disclaimer {
  font-size: 0.75rem; color: var(--text-muted);
  margin-top: 16px; line-height: 1.6;
  text-align: center;
}

/* ===== RESULTS PANEL ===== */
.results-panel { display: flex; flex-direction: column; gap: 28px; }
.results-header {}
.results-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.8rem; font-weight: 700; color: var(--navy);
  margin-bottom: 24px;
}

.estimated-range-box {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-mid) 100%);
  border-radius: var(--radius);
  padding: 28px 32px;
  color: #fff;
  box-shadow: var(--shadow-lg);
}
.range-label {
  font-size: 0.8rem; font-weight: 600; letter-spacing: 0.08em;
  text-transform: uppercase; color: rgba(255,255,255,0.6);
  margin-bottom: 12px;
}
.range-values {
  display: flex; align-items: baseline; gap: 12px;
  flex-wrap: wrap;
}
.range-low, .range-high {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.4rem, 3vw, 1.9rem); font-weight: 700;
}
.range-sep { color: rgba(255,255,255,0.4); font-size: 1.1rem; }
.range-mid-row {
  margin-top: 14px; padding-top: 14px;
  border-top: 1px solid rgba(255,255,255,0.15);
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 8px;
}
.range-mid-label { font-size: 0.85rem; color: rgba(255,255,255,0.65); }
.range-mid-val {
  font-size: 1.15rem; font-weight: 700;
  color: #90b8ff;
}

/* ===== METHOD RESULT CARDS ===== */
.method-results-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.result-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 20px;
  box-shadow: var(--shadow);
}
.result-card-header { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.result-card-icon {
  width: 40px; height: 40px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.7rem; font-weight: 800; letter-spacing: 0.03em;
  flex-shrink: 0;
}
.dcf-icon { background: #dbeafe; color: #1d4ed8; }
.rev-icon { background: #dcfce7; color: #15803d; }
.sde-icon { background: #fef3c7; color: #b45309; }
.result-card-title { font-size: 0.9rem; font-weight: 700; color: var(--navy); }
.result-card-sub { font-size: 0.75rem; color: var(--text-muted); margin-top: 2px; }
.result-card-value {
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem; font-weight: 700; color: var(--navy);
  margin-bottom: 6px;
}
.result-range-row {
  font-size: 0.8rem; color: var(--text-muted);
  display: flex; align-items: center; gap: 4px;
  margin-bottom: 6px;
}
.range-to { color: var(--border); }
.result-card-meta { font-size: 0.78rem; color: var(--text-muted); }

/* ===== CHART ===== */
.chart-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
  box-shadow: var(--shadow);
}
.chart-title {
  font-size: 1rem; font-weight: 700; color: var(--navy);
  margin-bottom: 20px;
}
.chart-container { height: 320px; }

/* ===== KEY METRICS ===== */
.key-metrics {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 28px;
  box-shadow: var(--shadow);
}
.metrics-title { font-size: 0.95rem; font-weight: 700; color: var(--navy); margin-bottom: 16px; }
.metrics-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.metric-item {
  background: var(--surface-alt);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
}
.metric-label { font-size: 0.78rem; color: var(--text-muted); font-weight: 500; margin-bottom: 4px; }
.metric-val { font-size: 1.05rem; font-weight: 700; color: var(--navy); }

/* ===== DCF TABLE ===== */
.dcf-table-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 28px;
  box-shadow: var(--shadow);
}
.dcf-table-title { font-size: 0.95rem; font-weight: 700; color: var(--navy); margin-bottom: 16px; }
.dcf-table-wrap { overflow-x: auto; }
.dcf-table { width: 100%; border-collapse: collapse; }
.dcf-table th {
  text-align: left; padding: 10px 14px;
  font-size: 0.78rem; font-weight: 700;
  color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em;
  border-bottom: 2px solid var(--border);
}
.dcf-table td {
  padding: 11px 14px;
  font-size: 0.9rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-primary);
}
.dcf-table tr:last-child td { border-bottom: none; }
.dcf-table tr:hover td { background: var(--surface-alt); }

/* ===== SAVE SECTION ===== */
.save-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 28px;
  box-shadow: var(--shadow);
  text-align: center;
}
.save-prompt p { color: var(--text-secondary); margin-bottom: 16px; font-size: 0.9rem; }
.btn-save-login {
  background: transparent; border: 2px solid var(--accent);
  color: var(--accent); padding: 10px 24px; border-radius: 8px;
  font-weight: 600; cursor: pointer; font-family: 'Inter', Arial, sans-serif;
  font-size: 0.9rem; transition: all 0.2s;
}
.btn-save-login:hover { background: var(--accent); color: #fff; }
.btn-save {
  background: var(--success); color: #fff;
  border: none; padding: 11px 28px; border-radius: 8px;
  font-weight: 600; cursor: pointer; font-family: 'Inter', Arial, sans-serif;
  font-size: 0.9rem; transition: background 0.2s;
}
.btn-save:hover { background: #168a52; }
.save-status { display: block; margin-top: 10px; font-size: 0.85rem; color: var(--success); }

/* ===== TRUST SECTION ===== */
.trust-section { padding: 72px 0; background: var(--navy); }
.trust-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 32px; }
.trust-item { text-align: center; }
.trust-icon { font-size: 2rem; margin-bottom: 14px; }
.trust-item h4 {
  font-size: 1rem; font-weight: 700; color: #fff; margin-bottom: 8px;
}
.trust-item p { font-size: 0.85rem; color: rgba(255,255,255,0.6); line-height: 1.6; }

/* ===== FOOTER ===== */
.site-footer { background: #080e18; padding: 40px 0; }
.footer-inner { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.footer-brand {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 4px;
}
.footer-brand-name {
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem; font-weight: 600; color: #fff;
}
.footer-disc { font-size: 0.78rem; color: rgba(255,255,255,0.35); max-width: 520px; line-height: 1.6; }
.footer-copy { font-size: 0.82rem; color: rgba(255,255,255,0.4); }

/* ===== AUTH MODAL ===== */
.modal-overlay {
  position: fixed; inset: 0; z-index: 2000;
  background: rgba(10, 18, 32, 0.75);
  backdrop-filter: blur(6px);
  display: none; align-items: center; justify-content: center;
  padding: 16px;
}
.modal-overlay.open { display: flex; }
.modal-box {
  background: var(--surface);
  border-radius: 16px;
  padding: 40px 36px;
  width: 100%; max-width: 420px;
  box-shadow: var(--shadow-lg);
  position: relative;
}
.modal-close {
  position: absolute; top: 16px; right: 20px;
  background: none; border: none; cursor: pointer;
  font-size: 1.5rem; color: var(--text-muted); line-height: 1;
}
.modal-close:hover { color: var(--text-primary); }
.modal-logo { text-align: center; margin-bottom: 16px; }
.modal-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.4rem; font-weight: 700; color: var(--navy);
  text-align: center; margin-bottom: 28px;
}
.modal-field { margin-bottom: 18px; }
.modal-field label {
  display: block; font-size: 0.875rem; font-weight: 600;
  color: var(--text-primary); margin-bottom: 7px;
}
.modal-field input {
  width: 100%;
  border: 1.5px solid var(--border);
  border-radius: 10px; padding: 11px 14px;
  font-size: 0.95rem; font-family: 'Inter', Arial, sans-serif;
  color: var(--text-primary); outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.modal-field input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(29,95,204,0.12);
}
.btn-modal-submit {
  width: 100%; padding: 13px;
  background: var(--accent); color: #fff;
  border: none; border-radius: 10px; cursor: pointer;
  font-size: 0.95rem; font-weight: 600;
  font-family: 'Inter', Arial, sans-serif;
  transition: background 0.2s;
  margin-top: 4px;
}
.btn-modal-submit:hover { background: var(--accent-light); }
.modal-link {
  display: block; text-align: center; margin-top: 12px;
  font-size: 0.85rem; color: var(--accent); text-decoration: none;
}
.modal-link:hover { text-decoration: underline; }
.modal-error { color: var(--danger); font-size: 0.85rem; margin-top: 10px; min-height: 20px; }
.modal-switch { text-align: center; margin-top: 20px; font-size: 0.875rem; color: var(--text-muted); }
.modal-switch a { color: var(--accent); text-decoration: none; font-weight: 600; }
.spam-note { font-size: 0.78rem; color: var(--text-muted); text-align: center; margin-top: 10px; line-height: 1.5; }
.verify-message {
  background: var(--success-bg); color: var(--success);
  border-radius: 8px; padding: 14px 16px;
  font-size: 0.875rem; text-align: center; line-height: 1.6;
}
.otp-message {
  font-size: 0.875rem; color: var(--text-secondary);
  text-align: center; margin-bottom: 16px;
}

/* ===== LOADING STATE ===== */
.loading-overlay {
  display: none;
  position: fixed; inset: 0; z-index: 1500;
  background: rgba(10,18,32,0.5);
  align-items: center; justify-content: center;
}
.loading-overlay.active { display: flex; }
.loading-spinner {
  width: 52px; height: 52px;
  border: 4px solid rgba(255,255,255,0.2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
  .estimator-layout { grid-template-columns: 1fr; }
  .form-panel { position: static; }
  .trust-grid { grid-template-columns: repeat(2, 1fr); }
  .methods-grid { grid-template-columns: 1fr; }
  .method-results-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .main-nav { display: none; flex-direction: column; position: absolute; top: 68px; left: 0; right: 0; background: var(--navy); padding: 16px 24px 24px; border-top: 1px solid rgba(255,255,255,0.08); gap: 4px; }
  .main-nav.open { display: flex; }
  .mobile-toggle { display: flex; }
  .hero-content { padding: 60px 24px; }
  .form-panel { padding: 28px 20px; }
  .estimated-range-box { padding: 22px 20px; }
  .how-section, .estimator-section { padding: 56px 0; }
}

@media (max-width: 480px) {
  .trust-grid { grid-template-columns: 1fr 1fr; gap: 24px; }
  .metrics-grid { grid-template-columns: 1fr; }
  .modal-box { padding: 28px 20px; }
  .range-low, .range-high { font-size: 1.3rem; }
}
