/* ============================================
   RATECOMPAS AI — Main Stylesheet
   ============================================ */

:root {
  --bg: #0a0e14;
  --bg-card: #111620;
  --bg-card-hover: #161d2a;
  --border: rgba(255,255,255,0.07);
  --border-hover: rgba(255,255,255,0.15);
  --text: #e8edf5;
  --text-muted: #6b7a94;
  --text-dim: #3d4a5e;
  --accent: #e8b84b;
  --accent-dim: rgba(232,184,75,0.12);
  --accent-hover: #f0c96a;
  --green: #2dd4a0;
  --red: #f06a6a;
  --font-display: 'DM Serif Display', Georgia, serif;
  --font-body: 'DM Sans', system-ui, sans-serif;
  --max-w: 1100px;
  --radius: 12px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }

.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 2rem;
}

/* ---- NAV ---- */
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 2.5rem;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: rgba(10,14,20,0.92);
  backdrop-filter: blur(12px);
  z-index: 100;
}

.nav-logo { display:flex; align-items:center; gap:2px;
  font-family: var(--font-display);
  font-size: 1.3rem;
  letter-spacing: -0.01em;
}
.nav-logo span { color: var(--accent); }
.nav-logo em { font-style: italic; font-size: 0.85rem; color: var(--text-muted); margin-left: 2px; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
  font-size: 0.9rem;
}
.nav-links a { color: var(--text-muted); transition: color 0.2s; }
.nav-links a:hover { color: var(--text); }

.nav-cta {
  background: var(--accent) !important;
  color: #0a0e14 !important;
  padding: 0.5rem 1.25rem;
  border-radius: 6px;
  font-weight: 500;
  transition: background 0.2s !important;
}
.nav-cta:hover { background: var(--accent-hover) !important; }

/* ---- HERO ---- */
.hero {
  min-height: 88vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 6rem 2rem 4rem;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -200px;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(232,184,75,0.06) 0%, transparent 70%);
  pointer-events: none;
}

.hero-eyebrow {
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.5rem;
  opacity: 0;
  animation: fadeUp 0.6s ease forwards 0.1s;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 6vw, 5rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  max-width: 800px;
  opacity: 0;
  animation: fadeUp 0.6s ease forwards 0.25s;
}
.hero-title em {
  font-style: italic;
  color: var(--accent);
}

.hero-sub {
  font-size: 1.15rem;
  color: var(--text-muted);
  max-width: 560px;
  margin-top: 1.5rem;
  line-height: 1.7;
  opacity: 0;
  animation: fadeUp 0.6s ease forwards 0.4s;
}

.hero-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  margin-top: 2.5rem;
  opacity: 0;
  animation: fadeUp 0.6s ease forwards 0.55s;
}

.btn-primary {
  display: inline-block;
  background: var(--accent);
  color: #0a0e14;
  font-weight: 500;
  font-size: 1rem;
  padding: 0.9rem 2.25rem;
  border-radius: 8px;
  transition: background 0.2s, transform 0.15s;
  cursor: pointer;
  border: none;
  font-family: var(--font-body);
}
.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

.hero-note {
  font-size: 0.82rem;
  color: var(--text-dim);
}

.hero-compass {
  width: 200px;
  height: 200px;
  margin-top: 4rem;
  opacity: 0;
  animation: fadeUp 0.8s ease forwards 0.7s, spin 40s linear infinite 1.5s;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* ---- HOW IT WORKS ---- */
.how {
  padding: 6rem 0;
  border-top: 1px solid var(--border);
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3vw, 2.5rem);
  text-align: center;
  margin-bottom: 3.5rem;
  letter-spacing: -0.02em;
}

.steps {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 1rem;
}

.step {
  flex: 1;
  max-width: 280px;
  text-align: center;
}

.step-num {
  font-family: var(--font-display);
  font-size: 3rem;
  color: var(--accent);
  opacity: 0.3;
  line-height: 1;
  margin-bottom: 1rem;
}

.step h3 {
  font-size: 1.05rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.step p {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.step-arrow {
  color: var(--text-dim);
  font-size: 1.5rem;
  margin-top: 2rem;
  flex-shrink: 0;
}

/* ---- FEATURES ---- */
.features {
  padding: 6rem 0;
  background: linear-gradient(180deg, transparent, rgba(232,184,75,0.02), transparent);
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  transition: border-color 0.2s, background 0.2s;
}
.feature-card:hover {
  border-color: var(--border-hover);
  background: var(--bg-card-hover);
}

.feature-icon {
  font-size: 1.5rem;
  color: var(--accent);
  margin-bottom: 1rem;
  opacity: 0.8;
}

.feature-card h3 {
  font-size: 1rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.feature-card p {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ---- LOAN TYPES ---- */
.loan-types {
  padding: 6rem 0;
  border-top: 1px solid var(--border);
}

.types-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.type-card {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  transition: border-color 0.2s, transform 0.2s;
  cursor: pointer;
}
.type-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.type-label {
  font-weight: 500;
  font-size: 1rem;
}

.type-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ---- CTA BAND ---- */
.cta-band {
  padding: 6rem 0;
  text-align: center;
  border-top: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}

.cta-band::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, rgba(232,184,75,0.05) 0%, transparent 70%);
  pointer-events: none;
}

.cta-band h2 {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3vw, 2.8rem);
  margin-bottom: 1rem;
  letter-spacing: -0.02em;
}

.cta-band p {
  color: var(--text-muted);
  margin-bottom: 2rem;
}

/* ---- FOOTER ---- */
.footer {
  border-top: 1px solid var(--border);
  padding: 4rem 0 2rem;
}

.footer-top {
  display: flex;
  gap: 4rem;
  margin-bottom: 3rem;
}

.footer-brand {
  flex: 1;
}

.footer-brand p {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-top: 0.75rem;
  max-width: 260px;
  line-height: 1.6;
}

.footer-links {
  display: flex;
  gap: 4rem;
}

.footer-col {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.footer-col h4 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  margin-bottom: 0.25rem;
}

.footer-col a {
  font-size: 0.875rem;
  color: var(--text-muted);
  transition: color 0.2s;
}
.footer-col a:hover { color: var(--text); }

.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: var(--text-dim);
}

.footer-legal {
  display: flex;
  gap: 1.5rem;
}

.footer-legal a { color: var(--text-dim); transition: color 0.2s; }
.footer-legal a:hover { color: var(--text-muted); }

/* ---- ANALYZER PAGE ---- */
.analyzer-hero {
  padding: 4rem 0 2rem;
  text-align: center;
  border-bottom: 1px solid var(--border);
}

.analyzer-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3rem);
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
}

.analyzer-hero p {
  color: var(--text-muted);
  font-size: 1.05rem;
}

.analyzer-wrap {
  max-width: 820px;
  margin: 3rem auto;
  padding: 0 2rem 6rem;
}

/* Form elements */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  font-weight: 500;
}

.form-input, .form-select {
  height: 44px;
  padding: 0 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 0.95rem;
  font-family: var(--font-body);
  transition: border-color 0.2s;
  width: 100%;
}

.form-input:focus, .form-select:focus {
  outline: none;
  border-color: var(--accent);
}

.form-select option { background: var(--bg-card); }

.analyze-btn {
  width: 100%;
  height: 52px;
  background: var(--accent);
  color: #0a0e14;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 500;
  font-family: var(--font-body);
  cursor: pointer;
  margin-top: 0.5rem;
  transition: background 0.2s, transform 0.15s;
}
.analyze-btn:hover { background: var(--accent-hover); transform: translateY(-1px); }

/* Results */
.results { display: none; margin-top: 2.5rem; }

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.metric-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
}

.metric-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

.metric-value {
  font-size: 1.75rem;
  font-weight: 300;
  font-family: var(--font-display);
  color: var(--text);
}

.metric-sub {
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-top: 0.25rem;
}

.result-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1rem;
}

.result-section-title {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  margin-bottom: 1.25rem;
}

/* Bars */
.bar-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
  font-size: 0.875rem;
}
.bar-label { width: 72px; color: var(--text-muted); flex-shrink: 0; }
.bar-track { flex: 1; height: 6px; background: rgba(255,255,255,0.05); border-radius: 3px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 3px; transition: width 0.5s ease; }
.bar-amt { width: 80px; text-align: right; font-weight: 500; color: var(--text); }

/* AI analysis */
.ai-text {
  font-size: 0.95rem;
  line-height: 1.75;
  color: var(--text);
}

.flags { margin-top: 1rem; display: flex; flex-wrap: wrap; gap: 6px; }

.flag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.78rem;
  padding: 4px 10px;
  border-radius: 20px;
  font-weight: 500;
}
.flag-ok { background: rgba(45,212,160,0.12); color: var(--green); }
.flag-warn { background: rgba(232,184,75,0.12); color: var(--accent); }
.flag-bad { background: rgba(240,106,106,0.12); color: var(--red); }

/* Spinner */
.spinner {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-muted);
  font-size: 0.9rem;
  padding: 0.5rem 0;
}
.spin-ring {
  width: 18px; height: 18px;
  border: 2px solid rgba(255,255,255,0.1);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin-anim 0.7s linear infinite;
}
@keyframes spin-anim { to { transform: rotate(360deg); } }

/* Lenders */
.lenders-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.lender-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  transition: border-color 0.2s;
}
.lender-card:hover { border-color: var(--border-hover); }
.lender-card.featured { border-color: var(--accent); }

.lender-badge {
  display: inline-block;
  font-size: 0.7rem;
  padding: 2px 8px;
  background: var(--accent-dim);
  color: var(--accent);
  border-radius: 20px;
  margin-bottom: 8px;
  font-weight: 500;
}

.lender-name { font-weight: 500; font-size: 0.95rem; margin-bottom: 4px; }
.lender-rate { font-family: var(--font-display); font-size: 1.75rem; margin: 6px 0 4px; }
.lender-save { font-size: 0.82rem; color: var(--green); font-weight: 500; }
.lender-note { font-size: 0.8rem; color: var(--text-muted); margin-top: 8px; line-height: 1.5; }

.disclaimer {
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-top: 1rem;
  line-height: 1.6;
}

/* ---- RESPONSIVE ---- */
@media (max-width: 768px) {
  .nav-links { display: none; }
  .steps { flex-direction: column; align-items: center; }
  .step-arrow { transform: rotate(90deg); margin: 0; }
  .form-grid { grid-template-columns: 1fr; }
  .metrics-grid { grid-template-columns: 1fr 1fr; }
  .lenders-grid { grid-template-columns: 1fr; }
  .footer-top { flex-direction: column; gap: 2rem; }
  .footer-bottom { flex-direction: column; gap: 1rem; text-align: center; }
}


/* ---- HERO LAYOUT ---- */
.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 6rem 2rem 4rem;
  position: relative;
  overflow: hidden;
  min-height: 88vh;
  gap: 1.5rem;
}

.hero-main {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 3.5rem;
  max-width: 960px;
  width: 100%;
}

.hero-left {
  flex-shrink: 0;
  width: 180px;
  padding-top: 0.35rem;
}

.hero-compass-svg {
  width: 180px;
  height: 180px;
  opacity: 0;
  animation: fadeUp 0.8s ease forwards 0.7s, spin 40s linear infinite 1.5s;
}

.hero-right {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
}

.hero-eyebrow {
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1rem;
  opacity: 0;
  animation: fadeUp 0.6s ease forwards 0.1s;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 6vw, 5rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0 0 1.5rem 0;
  opacity: 0;
  animation: fadeUp 0.6s ease forwards 0.25s;
}

.hero-title em {
  font-style: italic;
  color: var(--accent);
}

.hero-sub {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 520px;
  line-height: 1.7;
  margin: 0 0 2rem 0;
  opacity: 0;
  animation: fadeUp 0.6s ease forwards 0.4s;
}

.hero-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.75rem;
  opacity: 0;
  animation: fadeUp 0.6s ease forwards 0.55s;
}

.hero-note {
  font-size: 0.82rem;
  color: var(--text-dim);
}

@media (max-width: 768px) {
  .hero-main {
    flex-direction: column;
    align-items: center;
    gap: 2rem;
  }
  .hero-left {
    width: 120px;
    padding-top: 0;
  }
  .hero-compass-svg {
    width: 120px;
    height: 120px;
  }
  .hero-right {
    align-items: center;
    text-align: center;
  }
  .hero-actions {
    align-items: center;
  }
}

/* ---- HERO RIGHT TEXT ALIGN ---- */
.hero-right {
  text-align: left !important;
}
.hero-right .hero-actions {
  align-items: flex-start !important;
}

/* ---- HERO SIZE ADJUSTMENTS ---- */
.hero-title {
  font-size: clamp(2.4rem, 4.5vw, 4rem) !important;
}
.hero-left {
  width: 220px !important;
}
.hero-compass-svg {
  width: 220px !important;
  height: 220px !important;
}

/* ---- HEADLINE WRAP FIX ---- */
.hero-title {
  font-size: clamp(2.2rem, 4vw, 3.6rem) !important;
}
