/* LoanCalc.click — shared stylesheet
   Extracted from inline <style> so every page shares one cached file. */

:root {
  --bg: #f0f2ff;
  --surface: #ffffff;
  --surface2: #f8f9ff;
  --border: #e0e4ff;
  --text: #0f0f2a;
  --muted: #6366a0;
  --accent: #4f46e5;
  --accent2: #4338ca;
  --accent-light: #eef2ff;
  --accent-muted: #a5b4fc;
  --red: #dc2626;
  --gold: #d97706;
  --green: #16a34a;
  --navy: #1e1b4b;
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 4px 16px rgba(0,0,0,0.06);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.12);
  --radius: 14px;
  --radius-sm: 8px;
}
body.dark {
  --bg: #0a0a1a;
  --surface: #11112a;
  --surface2: #1a1a35;
  --border: #2a2a50;
  --text: #f1f5f9;
  --muted: #94a3b8;
  --accent-light: #1e1b4b;
  --navy: #1e1b4b;
}

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

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  transition: background 0.3s, color 0.3s;
}

/* Keyboard focus — visible on every interactive element */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* ── NAV ─────────────────────────────────────────────── */
.nav {
  background: var(--navy);
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(0,0,0,0.25);
}
.logo {
  font-size: 22px;
  font-weight: 800;
  color: #fff;
  text-decoration: none;
  letter-spacing: -0.5px;
}
.logo span { color: #818cf8; }
.nav-right { display: flex; align-items: center; gap: 12px; }
.nav-link {
  color: rgba(255,255,255,0.85);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
}
.nav-link:hover { color: #fff; text-decoration: underline; }
.dark-btn {
  background: rgba(255,255,255,0.1);
  border: none;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.dark-btn:hover { background: rgba(255,255,255,0.2); }

/* ── BREADCRUMB ──────────────────────────────────────── */
.crumb {
  max-width: 900px;
  margin: 0 auto;
  padding: 14px 16px 0;
  font-size: 13px;
  color: var(--muted);
}
.crumb a { color: var(--muted); text-decoration: none; }
.crumb a:hover { color: var(--accent); text-decoration: underline; }

/* ── HERO ────────────────────────────────────────────── */
.hero {
  background: linear-gradient(135deg, var(--navy) 0%, #312e81 50%, #4c1d95 100%);
  padding: 48px 24px 40px;
  text-align: center;
  color: #fff;
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 100px;
  padding: 6px 16px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 20px;
}
.hero h1 {
  font-size: clamp(30px, 5.5vw, 54px);
  font-weight: 800;
  line-height: 1.08;
  margin-bottom: 14px;
  letter-spacing: -2px;
}
.hero h1 em { font-style: normal; color: #818cf8; }
.hero-sub {
  font-size: 17px;
  color: rgba(255,255,255,0.75);
  max-width: 560px;
  margin: 0 auto;
  line-height: 1.6;
}

/* ── MAIN ────────────────────────────────────────────── */
.main { max-width: 900px; margin: 0 auto; padding: 32px 16px 60px; }

/* ── CALCULATOR ──────────────────────────────────────── */
.calc-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 24px;
  align-items: start;
}
@media (max-width: 720px) { .calc-grid { grid-template-columns: 1fr; } }

.calc-card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 28px;
  box-shadow: var(--shadow);
}
.calc-card h2 { font-size: 18px; font-weight: 700; margin-bottom: 24px; }

.field-group { margin-bottom: 20px; }
.field-group label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}
.field-hint {
  font-size: 12px;
  color: var(--muted);
  margin-top: 6px;
  line-height: 1.5;
}
.input-wrap {
  display: flex;
  align-items: center;
  background: var(--surface2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: border-color 0.2s;
}
.input-wrap:focus-within { border-color: var(--accent); }
.input-prefix, .input-suffix {
  padding: 0 12px;
  font-weight: 600;
  color: var(--muted);
  background: var(--surface2);
  height: 44px;
  display: flex;
  align-items: center;
}
.input-prefix { font-size: 16px; border-right: 1px solid var(--border); }
.input-suffix { font-size: 14px; border-left: 1px solid var(--border); }
.input-wrap input, .input-wrap select {
  flex: 1;
  min-width: 0;
  height: 44px;
  border: none;
  background: transparent;
  padding: 0 12px;
  font-size: 16px;
  font-weight: 500;
  color: var(--text);
  outline: none;
  font-family: inherit;
  -webkit-appearance: none;
}
.input-wrap select { cursor: pointer; }
.range-wrap { margin-top: 8px; }
.range-wrap input[type=range] {
  width: 100%;
  height: 4px;
  accent-color: var(--accent);
  cursor: pointer;
}
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ── RESULT ──────────────────────────────────────────── */
.result-card {
  background: linear-gradient(135deg, var(--navy) 0%, #312e81 100%);
  border-radius: var(--radius);
  padding: 28px;
  color: #fff;
  box-shadow: var(--shadow-lg);
  position: sticky;
  top: 84px;
}
.result-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.6);
  margin-bottom: 6px;
}
.result-amount {
  font-size: 52px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -2px;
}
.result-sub {
  font-size: 14px;
  color: rgba(255,255,255,0.6);
  margin: 4px 0 24px;
}
.result-bar {
  height: 6px;
  border-radius: 3px;
  background: rgba(255,255,255,0.15);
  margin-bottom: 20px;
  overflow: hidden;
  display: flex;
}
.bar-principal { background: #818cf8; height: 100%; transition: width 0.4s; }
.bar-interest { background: #f59e0b; height: 100%; transition: width 0.4s; }
.result-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  font-size: 14px;
}
.result-row:last-child { border-bottom: none; }
.result-row-label { color: rgba(255,255,255,0.7); display: flex; align-items: center; gap: 8px; }
.result-row-val { font-weight: 700; text-align: right; }
.result-row-val.red { color: #fca5a5; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.dot-p { background: #818cf8; }
.dot-i { background: #f59e0b; }

/* ── SUMMARY CARDS ───────────────────────────────────── */
.amort-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}
@media (max-width: 600px) { .amort-cards { grid-template-columns: 1fr 1fr; } }
.amort-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow);
}
.amort-card-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}
.amort-card-value { font-size: 22px; font-weight: 800; }
.amort-card-value.red { color: var(--red); }
.amort-card-value.green { color: var(--green); }
.amort-card-value.accent { color: var(--accent); }

/* ── TABLES ──────────────────────────────────────────── */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); }
.data-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.data-table th {
  background: var(--surface2);
  padding: 12px 16px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
}
.data-table td { padding: 10px 16px; border-bottom: 1px solid var(--border); }
.data-table tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover td { background: var(--surface2); }
.data-table .red { color: var(--red); font-weight: 600; }
.data-table .green { color: var(--green); font-weight: 600; }
.data-table caption {
  caption-side: bottom;
  padding: 12px 16px;
  font-size: 12px;
  color: var(--muted);
  text-align: left;
  line-height: 1.6;
}

.table-toggle {
  display: block;
  width: 100%;
  margin-top: 12px;
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--accent);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.table-toggle:hover { background: var(--accent-light); }

/* ── PROSE ───────────────────────────────────────────── */
.section-title {
  font-size: 22px;
  font-weight: 800;
  margin: 40px 0 16px;
  letter-spacing: -0.5px;
}
.prose { font-size: 15px; line-height: 1.75; color: var(--text); }
.prose p { margin-bottom: 16px; }
.prose h3 { font-size: 17px; font-weight: 700; margin: 28px 0 10px; }
.prose ul, .prose ol { margin: 0 0 16px 22px; }
.prose li { margin-bottom: 8px; }
.prose a { color: var(--accent); text-decoration: underline; }
.prose strong { font-weight: 700; }

.info-box {
  background: var(--accent-light);
  border: 1px solid var(--accent-muted);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin: 24px 0;
  font-size: 14px;
  line-height: 1.7;
}
.info-box strong { color: var(--accent); }
body.dark .info-box strong { color: var(--accent-muted); }

.source-note {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.6;
  margin: 16px 0;
  padding-left: 14px;
  border-left: 3px solid var(--border);
}
.source-note a { color: var(--muted); }

/* ── CARD LINKS ──────────────────────────────────────── */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 16px;
  margin: 24px 0;
}
.link-card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  text-decoration: none;
  color: var(--text);
  box-shadow: var(--shadow);
  transition: transform 0.15s, border-color 0.15s;
}
.link-card:hover { transform: translateY(-2px); border-color: var(--accent-muted); }
.link-card h3 { font-size: 16px; font-weight: 700; margin-bottom: 6px; }
.link-card p { font-size: 13px; color: var(--muted); line-height: 1.6; }

/* ── FAQ ─────────────────────────────────────────────── */
.faq { margin-top: 40px; }
.faq-title { font-size: 22px; font-weight: 800; margin-bottom: 12px; letter-spacing: -0.5px; }
.faq-item { border-bottom: 1px solid var(--border); }
.faq-item summary {
  padding: 18px 0;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  list-style: none;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: '+';
  font-size: 22px;
  color: var(--accent);
  flex-shrink: 0;
  transition: transform 0.2s;
}
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item .faq-a {
  font-size: 15px;
  color: var(--muted);
  line-height: 1.75;
  padding-bottom: 18px;
}
.faq-item .faq-a p { margin-bottom: 12px; }
.faq-item .faq-a p:last-child { margin-bottom: 0; }
.faq-item .faq-a a { color: var(--accent); }

/* ── AD SLOTS ────────────────────────────────────────── */
/* No border, no min-height: an unfilled slot collapses to nothing
   instead of showing an empty dashed box to visitors and reviewers. */
.ad-slot { margin: 28px 0; text-align: center; }
.ad-slot ins { display: block; }

/* ── FOOTER ──────────────────────────────────────────── */
footer {
  background: var(--navy);
  color: rgba(255,255,255,0.6);
  padding: 36px 24px;
  font-size: 13px;
  line-height: 1.8;
}
.footer-inner { max-width: 900px; margin: 0 auto; }
.footer-cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 24px;
  margin-bottom: 24px;
}
.footer-cols h4 {
  color: #fff;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 10px;
}
.footer-cols a { display: block; color: rgba(255,255,255,0.6); text-decoration: none; }
.footer-cols a:hover { color: #fff; text-decoration: underline; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.12);
  padding-top: 20px;
  font-size: 12px;
}
.footer-bottom strong { color: #818cf8; }

/* ── 404 ─────────────────────────────────────────────── */
.notfound { text-align: center; padding: 80px 16px; max-width: 620px; margin: 0 auto; }
.notfound .code {
  font-size: 96px;
  font-weight: 800;
  letter-spacing: -4px;
  color: var(--accent-muted);
  line-height: 1;
}
.notfound h1 { font-size: 26px; font-weight: 800; margin: 12px 0 10px; }
.notfound p { color: var(--muted); font-size: 15px; line-height: 1.7; }

/* ── MOBILE ──────────────────────────────────────────── */
@media (max-width: 720px) {
  .nav { height: 50px; padding: 0 16px; }
  .logo { font-size: 18px; }
  .hero { padding: 24px 16px 20px; }
  .hero-badge { font-size: 11px; padding: 4px 12px; margin-bottom: 12px; }
  .hero h1 { font-size: 26px; letter-spacing: -1px; margin-bottom: 8px; }
  .hero-sub { font-size: 14px; }
  .main { padding: 16px 12px 48px; }
  .calc-card { padding: 18px 16px; border-radius: 12px; }
  .calc-card h2 { font-size: 16px; margin-bottom: 18px; }
  .field-group { margin-bottom: 16px; }
  .field-group label { font-size: 10px; margin-bottom: 6px; }
  .input-wrap input, .input-wrap select { height: 42px; font-size: 15px; }
  .input-prefix, .input-suffix { height: 42px; font-size: 14px; padding: 0 10px; }
  .two-col { grid-template-columns: 1fr; gap: 0; }
  .result-card { position: static; border-radius: 12px; padding: 20px 18px; margin-top: 16px; }
  .result-amount { font-size: 36px; letter-spacing: -1px; }
  .result-sub { font-size: 12px; margin-bottom: 16px; }
  .result-label { font-size: 10px; }
  .result-row { font-size: 13px; padding: 7px 0; }
  .amort-cards { grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 20px; }
  .amort-card { padding: 14px; border-radius: 10px; }
  .amort-card-label { font-size: 10px; }
  .amort-card-value { font-size: 18px; }
  .data-table { font-size: 12px; }
  .data-table th { padding: 8px 10px; font-size: 10px; }
  .data-table td { padding: 7px 10px; }
  .section-title { font-size: 18px; margin: 32px 0 12px; }
  .info-box { padding: 14px 16px; font-size: 13px; }
  .faq-title { font-size: 18px; }
  .faq-item summary { font-size: 14px; padding: 14px 0; }
  .faq-item .faq-a { font-size: 13px; }
  footer { padding: 28px 16px; font-size: 12px; }
  .notfound { padding: 48px 16px; }
  .notfound .code { font-size: 64px; }
}

@media (max-width: 400px) {
  .hero h1 { font-size: 22px; }
  .result-amount { font-size: 30px; }
}
