/* ==============================================
   Financulator — Core Stylesheet
   Palette: Deep Navy #1a2744 | Gold #f5a623 | Soft White #f8f9fb
   ============================================== */

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

:root {
  --navy:   #1a2744;
  --navy2:  #243358;
  --gold:   #f5a623;
  --gold2:  #e09510;
  --white:  #ffffff;
  --off:    #f8f9fb;
  --muted:  #6b7a99;
  --border: #dde3ef;
  --green:  #22c55e;
  --red:    #ef4444;
  --radius: 12px;
  --shadow: 0 4px 24px rgba(26,39,68,.10);
  --shadow-lg: 0 8px 40px rgba(26,39,68,.16);
  --font:   'Inter', system-ui, -apple-system, sans-serif;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--off);
  color: var(--navy);
  line-height: 1.6;
  font-size: 16px;
}

a { color: var(--gold); text-decoration: none; }
a:hover { color: var(--gold2); }

img { max-width: 100%; display: block; }

/* ── TYPOGRAPHY ─────────────────────────────── */
h1 { font-size: clamp(2rem, 5vw, 3.2rem); line-height: 1.15; font-weight: 800; }
h2 { font-size: clamp(1.5rem, 3vw, 2.2rem); font-weight: 700; }
h3 { font-size: 1.2rem; font-weight: 600; }
h4 { font-size: 1rem; font-weight: 600; }
p  { color: #3d4f73; }

/* ── HEADER ─────────────────────────────────── */
.site-header {
  background: var(--navy);
  position: sticky; top: 0; z-index: 100;
  box-shadow: 0 2px 12px rgba(0,0,0,.2);
}

.header-inner {
  max-width: 1200px; margin: 0 auto;
  padding: 0 1.5rem;
  display: flex; align-items: center; justify-content: space-between;
  height: 64px;
}

.logo {
  display: flex; align-items: center; gap: 10px;
  font-size: 1.4rem; font-weight: 800; color: var(--white);
  letter-spacing: -.5px;
}

.logo span { color: var(--gold); }

.logo-icon {
  width: 34px; height: 34px; background: var(--gold);
  border-radius: 8px; display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
}

.site-nav { display: flex; gap: 2rem; align-items: center; }
.site-nav a { color: rgba(255,255,255,.8); font-size: .9rem; font-weight: 500; transition: color .2s; }
.site-nav a:hover { color: var(--gold); }
.site-nav .cta-btn {
  background: var(--gold); color: var(--navy); padding: .45rem 1.1rem;
  border-radius: 8px; font-weight: 700; font-size: .85rem; transition: background .2s;
}
.site-nav .cta-btn:hover { background: var(--gold2); color: var(--navy); }

.hamburger { display: none; flex-direction: column; gap: 5px; cursor: pointer; padding: 5px; }
.hamburger span { display: block; width: 24px; height: 2px; background: var(--white); border-radius: 2px; transition: all .3s; }

/* ── HERO ────────────────────────────────────── */
.hero {
  background: linear-gradient(135deg, var(--navy) 0%, #2a3f6b 60%, #1e3560 100%);
  padding: 5rem 1.5rem 4rem;
  text-align: center;
  position: relative; overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.hero-content { max-width: 780px; margin: 0 auto; position: relative; }

.hero-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(245,166,35,.15); border: 1px solid rgba(245,166,35,.4);
  color: var(--gold); padding: .35rem .9rem; border-radius: 999px;
  font-size: .8rem; font-weight: 600; letter-spacing: .5px;
  text-transform: uppercase; margin-bottom: 1.2rem;
}

.hero h1 { color: var(--white); margin-bottom: 1.2rem; }
.hero h1 span { color: var(--gold); }
.hero p { color: rgba(255,255,255,.75); font-size: 1.15rem; max-width: 580px; margin: 0 auto 2.2rem; }

.hero-ctas { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

.btn-primary {
  background: var(--gold); color: var(--navy); padding: .8rem 2rem;
  border-radius: 10px; font-weight: 700; font-size: 1rem;
  transition: transform .2s, box-shadow .2s;
  box-shadow: 0 4px 14px rgba(245,166,35,.4);
  display: inline-block;
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(245,166,35,.5); color: var(--navy); }

.btn-secondary {
  background: rgba(255,255,255,.1); color: var(--white); padding: .8rem 2rem;
  border-radius: 10px; font-weight: 600; font-size: 1rem; border: 1px solid rgba(255,255,255,.25);
  transition: background .2s; display: inline-block;
}
.btn-secondary:hover { background: rgba(255,255,255,.18); color: var(--white); }

.hero-stats {
  display: flex; justify-content: center; gap: 2.5rem; flex-wrap: wrap;
  margin-top: 3rem; padding-top: 2.5rem;
  border-top: 1px solid rgba(255,255,255,.12);
}

.stat { text-align: center; }
.stat-num { font-size: 1.8rem; font-weight: 800; color: var(--gold); display: block; }
.stat-label { font-size: .82rem; color: rgba(255,255,255,.6); text-transform: uppercase; letter-spacing: .5px; }

/* ── AD BANNER ──────────────────────────────── */
.ad-banner {
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1rem;
  text-align: center; color: var(--muted); font-size: .78rem;
  min-height: 90px; display: flex; align-items: center; justify-content: center;
  position: relative;
}
.ad-banner::before { content: 'Advertisement'; position: absolute; top: 4px; left: 10px; font-size: .65rem; color: var(--border); }
.ad-banner-wide { min-height: 90px; max-width: 728px; margin: 0 auto; }
.ad-banner-square { min-height: 250px; width: 100%; max-width: 300px; }

/* ── SECTION WRAPPERS ───────────────────────── */
.section { padding: 4rem 1.5rem; }
.section-sm { padding: 2.5rem 1.5rem; }
.container { max-width: 1200px; margin: 0 auto; }

.section-header { text-align: center; margin-bottom: 2.5rem; }
.section-header h2 { margin-bottom: .6rem; }
.section-header p { color: var(--muted); max-width: 560px; margin: 0 auto; }

/* ── CALCULATOR CARDS GRID ─────────────────── */
.calc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

.calc-card {
  background: var(--white); border-radius: var(--radius);
  border: 1px solid var(--border); padding: 1.6rem;
  transition: transform .2s, box-shadow .2s;
  cursor: pointer; display: block;
}
.calc-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: var(--gold); }

.calc-icon {
  width: 52px; height: 52px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; margin-bottom: 1rem;
}
.icon-blue   { background: #e8f0fe; }
.icon-green  { background: #e6f4ea; }
.icon-orange { background: #fef3e2; }
.icon-purple { background: #f3e8fd; }
.icon-teal   { background: #e0f5f5; }
.icon-red    { background: #fde8e8; }

.calc-card h3 { margin-bottom: .4rem; }
.calc-card p  { font-size: .88rem; color: var(--muted); margin-bottom: 1rem; }

.calc-tag {
  display: inline-block; padding: .2rem .65rem;
  border-radius: 999px; font-size: .72rem; font-weight: 600;
  background: #eef2ff; color: #4f46e5; text-transform: uppercase; letter-spacing: .3px;
}

/* ── CALCULATOR PAGE LAYOUT ─────────────────── */
.calc-page { display: grid; grid-template-columns: 1fr 340px; gap: 2rem; max-width: 1200px; margin: 0 auto; padding: 2rem 1.5rem; }

.calc-main { }
.calc-sidebar { }

.calc-box {
  background: var(--white); border-radius: var(--radius);
  border: 1px solid var(--border); padding: 2rem;
  box-shadow: var(--shadow);
}

.calc-box h2 { margin-bottom: .4rem; }
.calc-box .subtitle { color: var(--muted); margin-bottom: 1.8rem; font-size: .95rem; }

/* ── FORM ELEMENTS ──────────────────────────── */
.form-group { margin-bottom: 1.4rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

label {
  display: block; font-size: .85rem; font-weight: 600;
  color: var(--navy); margin-bottom: .4rem;
}

.input-wrap { position: relative; }
.input-prefix, .input-suffix {
  position: absolute; top: 50%; transform: translateY(-50%);
  color: var(--muted); font-weight: 600; font-size: .95rem; pointer-events: none;
}
.input-prefix { left: 12px; }
.input-suffix { right: 12px; }

input[type="number"], input[type="text"], select {
  width: 100%; padding: .7rem 1rem; border: 1.5px solid var(--border);
  border-radius: 8px; font-size: .95rem; color: var(--navy);
  background: var(--white); transition: border-color .2s, box-shadow .2s;
  font-family: var(--font);
}
.has-prefix input { padding-left: 2rem; }
.has-suffix input { padding-right: 2.2rem; }

input:focus, select:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(245,166,35,.15); }

input[type="range"] {
  width: 100%; accent-color: var(--gold); cursor: pointer; margin-top: .3rem;
  height: 6px; border-radius: 999px;
}

.range-labels { display: flex; justify-content: space-between; font-size: .75rem; color: var(--muted); margin-top: .3rem; }

.calc-btn {
  width: 100%; padding: .85rem; background: var(--gold); color: var(--navy);
  border: none; border-radius: 10px; font-size: 1rem; font-weight: 700;
  cursor: pointer; transition: background .2s, transform .2s;
  font-family: var(--font);
}
.calc-btn:hover { background: var(--gold2); transform: translateY(-1px); }

/* ── RESULTS BOX ────────────────────────────── */
.result-box {
  background: var(--navy); color: var(--white);
  border-radius: var(--radius); padding: 1.6rem;
  margin-top: 1.6rem; display: none;
}
.result-box.visible { display: block; }

.result-primary {
  text-align: center; padding-bottom: 1.2rem; margin-bottom: 1.2rem;
  border-bottom: 1px solid rgba(255,255,255,.12);
}
.result-label { font-size: .82rem; color: rgba(255,255,255,.6); text-transform: uppercase; letter-spacing: .5px; margin-bottom: .3rem; }
.result-value { font-size: 2.4rem; font-weight: 800; color: var(--gold); }
.result-sub { font-size: .85rem; color: rgba(255,255,255,.5); margin-top: .2rem; }

.result-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.result-item { }
.result-item .label { font-size: .75rem; color: rgba(255,255,255,.55); text-transform: uppercase; letter-spacing: .4px; }
.result-item .value { font-size: 1.1rem; font-weight: 700; color: var(--white); margin-top: .15rem; }
.result-item .value.pos { color: var(--green); }
.result-item .value.neg { color: var(--red); }

/* ── CHART ──────────────────────────────────── */
.chart-container { background: var(--white); border-radius: var(--radius); border: 1px solid var(--border); padding: 1.5rem; margin-top: 1.5rem; }
.chart-container h4 { margin-bottom: 1rem; }

canvas { width: 100% !important; }

/* ── AMORTIZATION TABLE ─────────────────────── */
.table-wrap { overflow-x: auto; margin-top: 1.5rem; }
table { width: 100%; border-collapse: collapse; font-size: .85rem; }
thead th { background: var(--navy); color: var(--white); padding: .7rem 1rem; text-align: left; font-size: .78rem; text-transform: uppercase; letter-spacing: .4px; }
tbody tr:nth-child(even) { background: var(--off); }
tbody td { padding: .6rem 1rem; border-bottom: 1px solid var(--border); color: #3d4f73; }
tbody tr:hover td { background: #eef2ff; }

/* ── SIDEBAR WIDGETS ────────────────────────── */
.sidebar-card {
  background: var(--white); border-radius: var(--radius);
  border: 1px solid var(--border); padding: 1.4rem; margin-bottom: 1.5rem;
}
.sidebar-card h4 { margin-bottom: .8rem; color: var(--navy); font-size: .95rem; }

.affiliate-card {
  border: 2px solid var(--gold);
  background: linear-gradient(135deg, #fffdf0 0%, var(--white) 100%);
}

.affiliate-logo {
  width: 100%; height: 48px; background: var(--off);
  border-radius: 8px; display: flex; align-items: center; justify-content: center;
  font-weight: 700; color: var(--navy); margin-bottom: .8rem; font-size: .9rem;
}

.aff-detail { font-size: .82rem; color: var(--muted); margin-bottom: .8rem; }
.aff-rate { font-size: 1.4rem; font-weight: 800; color: var(--navy); }
.aff-rate span { font-size: .85rem; font-weight: 400; color: var(--muted); }

.btn-aff {
  display: block; text-align: center; background: var(--navy); color: var(--white);
  padding: .6rem 1rem; border-radius: 8px; font-size: .85rem; font-weight: 600;
  transition: background .2s; margin-top: .8rem;
}
.btn-aff:hover { background: var(--navy2); color: var(--white); }

.disclosure { font-size: .7rem; color: var(--muted); margin-top: .5rem; text-align: center; }

/* ── TIPS LIST ──────────────────────────────── */
.tips-list { list-style: none; }
.tips-list li {
  padding: .6rem 0; border-bottom: 1px solid var(--border);
  font-size: .85rem; color: #3d4f73; display: flex; gap: .6rem; align-items: flex-start;
}
.tips-list li:last-child { border-bottom: none; }
.tips-list li::before { content: '✓'; color: var(--green); font-weight: 700; flex-shrink: 0; }

/* ── FEATURES STRIP ─────────────────────────── */
.features-strip {
  background: var(--white); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
}
.features-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.feature-item { text-align: center; padding: 2rem 1rem; }
.feature-icon { font-size: 2rem; margin-bottom: .8rem; }
.feature-item h4 { margin-bottom: .3rem; font-size: .95rem; }
.feature-item p { font-size: .82rem; color: var(--muted); }

/* ── TESTIMONIALS ───────────────────────────── */
.testimonials { background: var(--navy); }
.testimonials h2 { color: var(--white); }
.testimonials .section-header p { color: rgba(255,255,255,.6); }
.testi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.5rem; }
.testi-card {
  background: rgba(255,255,255,.06); border-radius: var(--radius);
  border: 1px solid rgba(255,255,255,.1); padding: 1.6rem;
}
.stars { color: var(--gold); font-size: 1rem; margin-bottom: .8rem; }
.testi-text { color: rgba(255,255,255,.85); font-size: .92rem; margin-bottom: 1rem; font-style: italic; }
.testi-author { color: rgba(255,255,255,.5); font-size: .8rem; font-weight: 600; }

/* ── NEWSLETTER ─────────────────────────────── */
.newsletter { background: linear-gradient(135deg, #1e3560 0%, var(--navy) 100%); padding: 3.5rem 1.5rem; text-align: center; }
.newsletter h2 { color: var(--white); margin-bottom: .6rem; }
.newsletter p { color: rgba(255,255,255,.7); margin-bottom: 2rem; }
.newsletter-form { display: flex; gap: .8rem; max-width: 460px; margin: 0 auto; flex-wrap: wrap; justify-content: center; }
.newsletter-form input {
  flex: 1; min-width: 220px; padding: .75rem 1.1rem;
  border: none; border-radius: 8px; font-size: .95rem;
}
.newsletter-form button {
  background: var(--gold); color: var(--navy); border: none;
  padding: .75rem 1.5rem; border-radius: 8px; font-weight: 700;
  cursor: pointer; font-size: .95rem; transition: background .2s;
  font-family: var(--font);
}
.newsletter-form button:hover { background: var(--gold2); }

/* ── FOOTER ─────────────────────────────────── */
.site-footer { background: #111827; color: rgba(255,255,255,.6); padding: 3rem 1.5rem 1.5rem; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 2.5rem; margin-bottom: 2rem; }
.footer-brand .logo { margin-bottom: .8rem; }
.footer-brand p { font-size: .85rem; max-width: 280px; }
.footer-col h5 { color: var(--white); font-size: .88rem; margin-bottom: .9rem; }
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: .5rem; }
.footer-col a { color: rgba(255,255,255,.5); font-size: .85rem; transition: color .2s; }
.footer-col a:hover { color: var(--gold); }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.08); padding-top: 1.2rem;
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .5rem;
  font-size: .8rem;
}
.footer-bottom a { color: rgba(255,255,255,.4); }

/* ── BREADCRUMB ─────────────────────────────── */
.breadcrumb { background: var(--white); border-bottom: 1px solid var(--border); padding: .6rem 0; }
.breadcrumb-inner { max-width: 1200px; margin: 0 auto; padding: 0 1.5rem; font-size: .82rem; color: var(--muted); }
.breadcrumb-inner a { color: var(--muted); }
.breadcrumb-inner a:hover { color: var(--gold); }
.breadcrumb-inner span { margin: 0 .4rem; }

/* ── PAGE HERO ──────────────────────────────── */
.page-hero {
  background: linear-gradient(135deg, var(--navy) 0%, #243358 100%);
  padding: 2.5rem 1.5rem; text-align: center;
}
.page-hero h1 { color: var(--white); font-size: clamp(1.6rem, 4vw, 2.4rem); margin-bottom: .5rem; }
.page-hero p { color: rgba(255,255,255,.7); max-width: 560px; margin: 0 auto; font-size: .95rem; }

/* ── INFO CARDS ─────────────────────────────── */
.info-section { padding: 2.5rem 1.5rem 1.5rem; }
.info-card { background: var(--white); border-radius: var(--radius); border: 1px solid var(--border); padding: 1.5rem; margin-bottom: 1.2rem; }
.info-card h3 { margin-bottom: .6rem; font-size: 1rem; }
.info-card p  { font-size: .88rem; color: #4a5568; line-height: 1.7; }

/* ── TOGGLE TABS ────────────────────────────── */
.tab-bar { display: flex; gap: .5rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.tab-btn {
  padding: .5rem 1.1rem; border-radius: 8px; border: 1.5px solid var(--border);
  background: var(--white); color: var(--muted); font-size: .85rem; font-weight: 600;
  cursor: pointer; transition: all .2s; font-family: var(--font);
}
.tab-btn.active { background: var(--navy); color: var(--white); border-color: var(--navy); }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* ── MOBILE NAV ─────────────────────────────── */
.mobile-nav {
  display: none; position: fixed; inset: 0; background: var(--navy);
  z-index: 200; flex-direction: column; align-items: center; justify-content: center;
  gap: 2rem;
}
.mobile-nav.open { display: flex; }
.mobile-nav a { color: var(--white); font-size: 1.3rem; font-weight: 700; }
.mobile-nav .close-btn { position: absolute; top: 1.5rem; right: 1.5rem; background: none; border: none; color: var(--white); font-size: 1.5rem; cursor: pointer; }

/* ── UTILITIES ──────────────────────────────── */
.text-center { text-align: center; }
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-2 { margin-bottom: 1rem; }
.hidden { display: none !important; }

/* ── RESPONSIVE ─────────────────────────────── */
@media (max-width: 960px) {
  .calc-page { grid-template-columns: 1fr; }
  .calc-sidebar { order: -1; display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .features-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
  .site-nav { display: none; }
  .hamburger { display: flex; }
  .hero { padding: 3.5rem 1.2rem 3rem; }
  .hero-stats { gap: 1.5rem; }
  .calc-sidebar { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .result-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .features-grid { grid-template-columns: 1fr 1fr; }
  .footer-bottom { flex-direction: column; text-align: center; }
}
