/* File: style.css — FinanceKit Pro Premium UI */
/* Design: Luxury Dark Finance — inspired by premium fintech dashboards */

/* === RESET === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
img, svg { display: block; max-width: 100%; }
ul { list-style: none; }

/* === FONTS === */
@import url('https://fonts.googleapis.com/css2?family=Sora:wght@300;400;500;600;700;800&family=Space+Mono:wght@400;700&family=DM+Mono:ital,wght@0,300;0,400;0,500;1,300;1,400;1,500&family=Instrument+Serif:ital@0;1&display=swap');

/* === VARIABLES (Light) === */
:root {
  --primary:        #0A1628;
  --primary-mid:    #1B2E4A;
  --primary-light:  #243858;
  --accent:         #F5A623;
  --accent-glow:    rgba(245,166,35,0.25);
  --accent-hover:   #E8951A;
  --teal:           #00C9B1;
  --teal-glow:      rgba(0,201,177,0.15);
  --bg:             #F0F2F8;
  --bg-alt:         #E8EBF4;
  --card-bg:        #FFFFFF;
  --card-border:    rgba(255,255,255,0.9);
  --text-primary:   #0A1628;
  --text-muted:     #5A6A82;
  --text-light:     #8A97AB;
  --success:        #10B981;
  --danger:         #EF4444;
  --border:         #DCE2EE;
  --shadow-sm:      0 2px 8px rgba(10,22,40,0.07);
  --shadow-md:      0 8px 32px rgba(10,22,40,0.10);
  --shadow-lg:      0 20px 60px rgba(10,22,40,0.15);
  --shadow-card:    0 4px 24px rgba(10,22,40,0.08), 0 1px 4px rgba(10,22,40,0.05);
  --font:           'Sora', sans-serif;
  --font-mono:      'DM Mono', 'Space Mono', monospace;
  --font-serif:     'Instrument Serif', Georgia, serif;
  --radius-sm:      8px;
  --radius-md:      14px;
  --radius-lg:      20px;
  --radius-xl:      28px;
  --header-h:       72px;
  --t:              0.25s ease;
  --t-slow:         0.4s ease;
}

/* === DARK MODE === */
[data-theme="dark"] {
  --bg:             #070E1C;
  --bg-alt:         #0D1726;
  --card-bg:        #0F1E35;
  --card-border:    rgba(255,255,255,0.04);
  --text-primary:   #E8EEF8;
  --text-muted:     #7A8FAD;
  --text-light:     #4A5F7A;
  --border:         rgba(255,255,255,0.07);
  --shadow-sm:      0 2px 8px rgba(0,0,0,0.25);
  --shadow-md:      0 8px 32px rgba(0,0,0,0.35);
  --shadow-lg:      0 20px 60px rgba(0,0,0,0.5);
  --shadow-card:    0 4px 24px rgba(0,0,0,0.3), 0 1px 4px rgba(0,0,0,0.2);
}

/* === BASE === */
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text-primary);
  font-size: 16px;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background var(--t-slow), color var(--t-slow);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; transition: all var(--t); }
a:hover { opacity: 0.85; }
main { flex: 1; max-width: 1200px; margin: 0 auto; width: 100%; padding: 2rem 1.5rem 4rem; }

/* === HEADER === */
.site-header {
  position: sticky; top: 0; z-index: 1000;
  height: var(--header-h);
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: background var(--t-slow), border-color var(--t-slow);
}
[data-theme="dark"] .site-header {
  background: rgba(7,14,28,0.92);
  border-bottom-color: rgba(255,255,255,0.06);
}
.header-inner {
  width: 100%; max-width: 1200px; margin: 0 auto;
  padding: 0 1.5rem;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  height: 100%;
}
.logo {
  font-size: 1.2rem; font-weight: 800;
  color: var(--text-primary);
  display: flex; align-items: center; gap: 0.4rem;
  letter-spacing: -0.04em; white-space: nowrap;
}
.logo span { color: var(--accent); }
.nav-links { display: flex; align-items: center; gap: 0.15rem; }
.nav-links a {
  font-size: 0.82rem; font-weight: 600; color: var(--text-muted);
  padding: 0.45rem 0.85rem; border-radius: 8px;
  transition: all var(--t); letter-spacing: 0.01em;
}
.nav-links a:hover { color: var(--text-primary); background: var(--bg); }
.nav-links a.active {
  color: var(--accent);
  background: var(--accent-glow);
}
[data-theme="dark"] .nav-links a:hover { background: rgba(255,255,255,0.06); }
[data-theme="dark"] .nav-links a.active { background: rgba(245,166,35,0.12); }

/* === THEME TOGGLE === */
.theme-toggle {
  background: var(--bg); border: 1.5px solid var(--border);
  border-radius: 50px; width: 50px; height: 26px;
  cursor: pointer; display: flex; align-items: center;
  padding: 2px; transition: all var(--t); position: relative;
  flex-shrink: 0;
}
.toggle-knob {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; transition: all var(--t);
  position: absolute; left: 2px;
}
[data-theme="dark"] .toggle-knob { left: calc(100% - 24px); background: var(--accent); }

/* === HAMBURGER === */
.hamburger {
  display: none; flex-direction: column; gap: 5px;
  background: none; border: none; cursor: pointer; padding: 6px;
}
.hamburger span {
  display: block; width: 22px; height: 2px;
  background: var(--text-primary); border-radius: 2px; transition: all var(--t);
}
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* === MOBILE NAV === */
.mobile-nav {
  display: none; position: fixed; top: var(--header-h); left: 0; right: 0;
  background: var(--card-bg); border-bottom: 1px solid var(--border);
  padding: 1rem 1.5rem; z-index: 999;
  box-shadow: var(--shadow-md); flex-direction: column; gap: 0.25rem;
  transform: translateY(-20px); opacity: 0;
  transition: all var(--t);
}
.mobile-nav.open { display: flex; transform: translateY(0); opacity: 1; }
.mobile-nav a {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.75rem 1rem; border-radius: var(--radius-md);
  font-size: 0.9rem; font-weight: 600; color: var(--text-muted);
  transition: all var(--t);
}
.mobile-nav a:hover { background: var(--bg); color: var(--text-primary); }

/* === CARDS === */
.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow-card);
  transition: box-shadow var(--t), transform var(--t), border-color var(--t);
  animation: slideUp 0.4s ease both;
  position: relative;
}
.card:hover { box-shadow: var(--shadow-md); }

[data-theme="dark"] .card {
  border-color: rgba(255,255,255,0.07);
  background: linear-gradient(145deg, rgba(15,30,53,0.95), rgba(10,20,38,0.98));
  box-shadow: 0 4px 24px rgba(0,0,0,0.3), 0 1px 4px rgba(0,0,0,0.2), inset 0 1px 0 rgba(255,255,255,0.05);
}

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

.card-title {
  font-size: 1rem; font-weight: 700;
  color: var(--text-primary); margin-bottom: 1.25rem;
  letter-spacing: -0.02em;
}

/* === HERO === */
.hero {
  text-align: center;
  padding: 4rem 1rem 3rem;
  position: relative;
}
.hero::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse 80% 60% at 50% -10%, var(--accent-glow), transparent);
  pointer-events: none;
}
[data-theme="dark"] .hero::before {
  background: radial-gradient(ellipse 80% 60% at 50% -10%, rgba(245,166,35,0.08), transparent);
}
.hero-badge {
  display: inline-flex; align-items: center; gap: 0.4rem;
  background: var(--accent-glow);
  border: 1px solid rgba(245,166,35,0.4);
  color: #b87010; border-radius: 50px;
  font-size: 0.78rem; font-weight: 700; padding: 0.4rem 1rem;
  text-transform: uppercase; letter-spacing: 0.08em;
  margin-bottom: 1.5rem;
}
[data-theme="dark"] .hero-badge { color: var(--accent); border-color: rgba(245,166,35,0.3); }
.hero h1 {
  font-size: clamp(2rem, 5vw, 3.4rem);
  font-weight: 800; line-height: 1.15;
  letter-spacing: -0.04em;
  color: var(--text-primary);
  margin-bottom: 1rem;
}
.hero h1 em {
  font-style: normal;
  background: linear-gradient(135deg, var(--accent), #FF8A00);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero p {
  font-size: 1.05rem; color: var(--text-muted);
  max-width: 560px; margin: 0 auto 2rem;
  line-height: 1.7;
}
.hero-cta { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; margin-bottom: 2.5rem; }
.stat-pills { display: flex; gap: 0.75rem; justify-content: center; flex-wrap: wrap; }
.stat-pill {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px; padding: 0.75rem 1.25rem;
  display: flex; flex-direction: column; align-items: center;
  box-shadow: var(--shadow-sm);
}
.stat-pill strong { font-size: 1.1rem; font-weight: 800; color: var(--accent); letter-spacing: -0.03em; }
.stat-pill span { font-size: 0.72rem; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }

/* === BUTTONS === */
.btn {
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-family: var(--font); font-size: 0.875rem; font-weight: 700;
  padding: 0.7rem 1.5rem; border-radius: 10px;
  border: 2px solid transparent; cursor: pointer;
  transition: all var(--t); letter-spacing: 0.01em;
  white-space: nowrap;
}
.btn-primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.btn-primary:hover { background: var(--primary-mid); border-color: var(--primary-mid); transform: translateY(-1px); box-shadow: 0 6px 20px rgba(10,22,40,0.2); }
[data-theme="dark"] .btn-primary { background: var(--accent); border-color: var(--accent); color: #0A1628; }
[data-theme="dark"] .btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }

.btn-secondary {
  background: transparent; color: var(--text-primary);
  border-color: var(--border);
}
.btn-secondary:hover { border-color: var(--text-muted); background: var(--bg); }

.btn-affiliate {
  display: flex; align-items: center; justify-content: center; gap: 0.5rem;
  width: 100%; padding: 1rem 1.5rem; margin-top: 1rem;
  background: linear-gradient(135deg, var(--accent), #FF8A00);
  color: #fff; font-family: var(--font); font-size: 0.95rem; font-weight: 700;
  border: none; border-radius: var(--radius-md); cursor: pointer;
  letter-spacing: 0.01em;
  transition: all var(--t);
  box-shadow: 0 4px 20px var(--accent-glow);
  animation: pulse-btn 3s ease infinite;
}
.btn-affiliate:hover { transform: translateY(-2px); box-shadow: 0 8px 30px rgba(245,166,35,0.4); }

@keyframes pulse-btn {
  0%, 100% { box-shadow: 0 4px 20px rgba(245,166,35,0.3); }
  50%       { box-shadow: 0 4px 30px rgba(245,166,35,0.55); }
}

.btn-aff-sm {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.65rem 1.25rem;
  background: linear-gradient(135deg, var(--accent), #FF8A00);
  color: #fff; font-family: var(--font); font-size: 0.85rem; font-weight: 700;
  border-radius: 8px; border: none; cursor: pointer;
  transition: all var(--t);
}
.btn-aff-sm:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(245,166,35,0.4); }

.w-full { width: 100%; }

/* === SECTION HEADINGS === */
.section-heading {
  font-size: 1.9rem; font-weight: 800;
  letter-spacing: -0.04em; margin-bottom: 0.5rem;
}
.section-sub {
  color: var(--text-muted); font-size: 0.95rem;
  margin-bottom: 2rem;
}
.text-center { text-align: center; }

/* === TOOL GRID (Homepage) === */
.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
}
.tool-card {
  display: flex; flex-direction: column; gap: 0.75rem;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}
.tool-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--accent), #FF8A00);
  opacity: 0; transition: opacity var(--t);
}
.tool-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.tool-card:hover::before { opacity: 1; }
.tool-card-icon {
  font-size: 2.2rem; display: block;
  filter: drop-shadow(0 2px 6px var(--accent-glow));
}
.tool-card h3 { font-size: 1rem; font-weight: 700; letter-spacing: -0.02em; }
.tool-card p { font-size: 0.85rem; color: var(--text-muted); flex: 1; line-height: 1.6; }
.tool-card .btn { margin-top: auto; align-self: flex-start; }

/* === FEATURES GRID === */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}
.feature-box { text-align: center; }
.feature-icon { font-size: 2.4rem; margin-bottom: 0.75rem; display: block; }
.feature-box h3 { font-size: 1rem; font-weight: 700; margin-bottom: 0.4rem; }
.feature-box p { font-size: 0.85rem; color: var(--text-muted); line-height: 1.65; }

/* === PAGE TITLE === */
.page-title {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 800; letter-spacing: -0.04em;
  margin-bottom: 0.4rem;
}
.page-subtitle {
  color: var(--text-muted); font-size: 0.95rem;
  margin-bottom: 2rem;
}

/* === TWO COLUMN LAYOUT === */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
  align-items: start;
}

/* === FORM ELEMENTS === */
.form-group { margin-bottom: 1.25rem; }
.form-group label {
  display: block; font-size: 0.8rem; font-weight: 700;
  color: var(--text-muted); text-transform: uppercase;
  letter-spacing: 0.06em; margin-bottom: 0.5rem;
}
input[type="number"], input[type="text"], select {
  width: 100%; padding: 0.75rem 1rem;
  font-family: var(--font); font-size: 0.95rem; font-weight: 600;
  color: var(--text-primary);
  background: var(--bg);
  border: 1.5px solid var(--border); border-radius: 10px;
  outline: none; transition: all var(--t);
  -moz-appearance: textfield;
  -webkit-appearance: none;
  appearance: none;
}
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%235A6A82' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.9rem center;
  padding-right: 2.5rem;
  cursor: pointer;
}
[data-theme="dark"] select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%237A8FAD' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
}
input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; }
input:focus, select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
  background: var(--card-bg);
}
[data-theme="dark"] input[type="number"],
[data-theme="dark"] input[type="text"],
[data-theme="dark"] select {
  background: rgba(255,255,255,0.04);
  border-color: rgba(255,255,255,0.1);
  color: var(--text-primary);
}
[data-theme="dark"] input:focus, [data-theme="dark"] select:focus {
  border-color: var(--accent); background: rgba(255,255,255,0.06);
}

/* === SLIDER ROW === */
.slider-row {
  display: flex; align-items: center; gap: 0.75rem;
}
.slider-row input[type="range"] {
  flex: 1; padding: 0;
  -webkit-appearance: none; appearance: none;
  height: 6px; border-radius: 6px;
  background: var(--border);
  outline: none; border: none; box-shadow: none;
  cursor: pointer; transition: background var(--t);
}
.slider-row input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--accent);
  border: 3px solid var(--card-bg);
  box-shadow: 0 2px 8px rgba(245,166,35,0.4);
  cursor: pointer; transition: transform var(--t);
}
.slider-row input[type="range"]::-webkit-slider-thumb:hover { transform: scale(1.15); }
.slider-row input[type="number"] {
  width: 110px; flex-shrink: 0;
  font-family: var(--font-mono); text-align: right;
  font-size: 0.88rem;
}

/* === TOGGLE GROUP (Months / Years) === */
.toggle-group {
  display: flex; border-radius: 8px;
  background: var(--bg); border: 1.5px solid var(--border);
  overflow: hidden; flex-shrink: 0;
}
.toggle-group button {
  padding: 0.45rem 0.9rem; font-family: var(--font);
  font-size: 0.78rem; font-weight: 700; cursor: pointer;
  background: none; border: none; color: var(--text-muted);
  transition: all var(--t); letter-spacing: 0.03em;
}
.toggle-group button.active {
  background: var(--primary); color: #fff; border-radius: 6px;
}
[data-theme="dark"] .toggle-group button.active { background: var(--accent); color: #0A1628; }

/* === RESULT BOX === */
.result-box {
  background: linear-gradient(135deg, var(--primary), var(--primary-mid));
  border-radius: var(--radius-lg);
  padding: 2rem;
  text-align: center;
  margin-bottom: 1.25rem;
  position: relative; overflow: hidden;
}
.result-box::before {
  content: ''; position: absolute; top: -40%; right: -20%;
  width: 280px; height: 280px; border-radius: 50%;
  background: rgba(245,166,35,0.1); pointer-events: none;
}
[data-theme="dark"] .result-box {
  background: linear-gradient(135deg, #0D1F3A, #152C4E);
  border: 1px solid rgba(245,166,35,0.2);
}
.result-label {
  font-size: 0.75rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.1em; color: rgba(255,255,255,0.6);
  margin-bottom: 0.5rem;
}
.result-number {
  font-size: clamp(1.8rem, 5vw, 2.8rem);
  font-weight: 500;
  color: #fff;
  letter-spacing: -0.03em;
  font-family: var(--font-mono);
  line-height: 1.1;
  font-feature-settings: "tnum" 1, "lnum" 1;
}
.result-sub {
  font-size: 0.8rem; color: rgba(255,255,255,0.5); margin-top: 0.4rem;
}

/* === RESULT ROWS === */
.result-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.875rem;
}
.result-row:last-child { border-bottom: none; }
.result-row .label { color: var(--text-muted); font-weight: 500; }
.result-row .value {
  font-weight: 600;
  font-family: var(--font-mono);
  letter-spacing: -0.02em;
  font-feature-settings: "tnum" 1, "lnum" 1;
}

/* === CHART WRAP === */
.chart-wrap { position: relative; height: 240px; }

/* === AD BANNER === */
.ad-banner {
  border: 2px dashed var(--border);
  border-radius: var(--radius-md);
  padding: 1.5rem; text-align: center;
  color: var(--text-light); font-size: 0.8rem;
  margin: 1.5rem 0; background: var(--bg);
}

/* === TABS === */
.tabs {
  display: flex; gap: 0.5rem; flex-wrap: wrap;
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 0.4rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
}
.tab-btn {
  flex: 1; min-width: 120px;
  padding: 0.65rem 1rem;
  font-family: var(--font); font-size: 0.82rem; font-weight: 700;
  color: var(--text-muted); background: none;
  border: none; border-radius: 10px; cursor: pointer;
  transition: all var(--t); letter-spacing: 0.01em;
}
.tab-btn:hover { color: var(--text-primary); background: var(--bg); }
.tab-btn.active {
  background: var(--primary); color: #fff;
  box-shadow: 0 3px 12px rgba(10,22,40,0.2);
}
[data-theme="dark"] .tab-btn.active { background: var(--accent); color: #0A1628; }

/* === AMORTIZATION TABLE === */
.table-section { padding: 1.5rem; }
.table-section-title { font-size: 1.1rem; font-weight: 700; }
.table-wrap { overflow-x: auto; margin-top: 1rem; border-radius: var(--radius-md); border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
thead { background: var(--primary); color: #fff; position: sticky; top: 0; }
[data-theme="dark"] thead { background: rgba(245,166,35,0.12); color: var(--text-primary); }
th {
  padding: 0.85rem 1rem; text-align: right;
  font-size: 0.72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.05em; white-space: nowrap;
}
th:first-child, td:first-child { text-align: left; }
td {
  padding: 0.75rem 1rem; text-align: right;
  border-bottom: 1px solid var(--border);
  font-family: var(--font-mono); font-size: 0.8rem;
  transition: background var(--t);
}
tr:last-child td { border-bottom: none; }
tbody tr:nth-child(even) { background: var(--bg); }
tbody tr:hover { background: var(--accent-glow); }

/* === FAQ === */
.faq-section { margin-top: 2.5rem; }
.faq-title {
  font-size: 1.5rem; font-weight: 800;
  letter-spacing: -0.03em; margin-bottom: 1.25rem;
}
.faq-item {
  border: 1px solid var(--border); border-radius: var(--radius-md);
  margin-bottom: 0.6rem; overflow: hidden;
  background: var(--card-bg);
  transition: box-shadow var(--t);
}
.faq-item:hover { box-shadow: var(--shadow-sm); }
.faq-question {
  display: flex; justify-content: space-between; align-items: center;
  padding: 1.1rem 1.25rem; cursor: pointer;
  font-size: 0.9rem; font-weight: 600;
  color: var(--text-primary); gap: 1rem;
  user-select: none;
}
.faq-icon {
  width: 24px; height: 24px; flex-shrink: 0;
  background: var(--bg); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; font-weight: 700; color: var(--text-muted);
  transition: all var(--t);
}
.faq-item.open .faq-icon { background: var(--accent); color: #fff; transform: rotate(45deg); }
.faq-answer {
  max-height: 0; overflow: hidden;
  padding: 0 1.25rem; font-size: 0.875rem;
  color: var(--text-muted); line-height: 1.7;
  transition: max-height 0.35s ease, padding 0.35s ease;
}
.faq-item.open .faq-answer { max-height: 400px; padding: 0 1.25rem 1.25rem; }

/* === AFFILIATE SECTION === */
.affiliate-section {
  background: linear-gradient(135deg, var(--primary), var(--primary-mid));
  border-radius: var(--radius-xl); padding: 2.5rem;
  text-align: center; margin: 2rem 0;
  position: relative; overflow: hidden;
}
.affiliate-section::before {
  content: ''; position: absolute; bottom: -60%; right: -10%;
  width: 300px; height: 300px; border-radius: 50%;
  background: rgba(245,166,35,0.1);
}
[data-theme="dark"] .affiliate-section {
  background: linear-gradient(135deg, #0D1F3A, #152C4E);
  border: 1px solid rgba(245,166,35,0.15);
}
.affiliate-section h3 { font-size: 1.4rem; font-weight: 800; color: #fff; margin-bottom: 0.5rem; letter-spacing: -0.03em; }
.affiliate-section > p { color: rgba(255,255,255,0.6); font-size: 0.9rem; margin-bottom: 1.75rem; }
.affiliate-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; }
.affiliate-card {
  background: rgba(255,255,255,0.07); border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--radius-md); padding: 1.25rem;
  text-align: center; display: flex; flex-direction: column; gap: 0.5rem;
  backdrop-filter: blur(10px);
}
.affiliate-card h4 { font-size: 0.9rem; font-weight: 700; color: #fff; }
.affiliate-card p { font-size: 0.78rem; color: rgba(255,255,255,0.55); flex: 1; line-height: 1.5; }

/* === EXTRA PAYMENT SECTION === */
.extra-payment-section {
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 1.75rem;
  margin: 1.5rem 0;
  box-shadow: var(--shadow-card);
}
.extra-payment-section h3 {
  font-size: 1rem; font-weight: 700;
  margin-bottom: 0.25rem; letter-spacing: -0.02em;
}
.extra-payment-section > p { font-size: 0.82rem; color: var(--text-muted); margin-bottom: 1.25rem; }
.extra-results {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem; margin-top: 1.25rem;
}
.extra-result-item {
  text-align: center; background: var(--bg);
  border-radius: var(--radius-md); padding: 1rem;
  border: 1px solid var(--border);
}
.extra-result-item .val {
  font-size: 1.1rem; font-weight: 800;
  color: var(--success); font-family: var(--font-mono);
  letter-spacing: -0.02em;
}
.extra-result-item .lbl { font-size: 0.72rem; color: var(--text-muted); font-weight: 600; margin-top: 0.2rem; text-transform: uppercase; letter-spacing: 0.04em; }

/* === TOAST === */
#toast-container { position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 9999; display: flex; flex-direction: column; gap: 0.5rem; }
.toast {
  padding: 0.85rem 1.25rem; border-radius: var(--radius-md);
  font-family: var(--font); font-size: 0.875rem; font-weight: 600;
  box-shadow: var(--shadow-md); min-width: 220px;
  animation: toastIn 0.3s ease;
}
.toast.success { background: var(--success); color: #fff; }
.toast.error   { background: var(--danger); color: #fff; }
.toast.info    { background: var(--primary); color: #fff; }
@keyframes toastIn { from { transform: translateX(110%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* === LOADER === */
.loader-overlay {
  position: absolute; inset: 0; border-radius: inherit;
  background: rgba(var(--bg), 0.8);
  display: flex; align-items: center; justify-content: center; z-index: 10;
}
.loader-overlay.hidden { display: none; }
.loader {
  width: 36px; height: 36px; border-radius: 50%;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* === FLEX UTILS === */
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mb-4 { margin-bottom: 1rem; }
.hidden { display: none !important; }

/* === CALCULATOR === */
.calc-layout {
  display: grid; grid-template-columns: 1fr 340px;
  gap: 1.5rem; align-items: start;
}
.calc-display {
  background: var(--primary);
  border-radius: var(--radius-md); padding: 1.5rem;
  margin-bottom: 1rem; min-height: 90px;
  display: flex; flex-direction: column; align-items: flex-end;
  position: relative; overflow: hidden;
}
[data-theme="dark"] .calc-display {
  background: linear-gradient(135deg, #0D1F3A, #152C4E);
  border: 1px solid rgba(245,166,35,0.1);
}
.calc-display::before {
  content: ''; position: absolute; top: -30%; right: -10%;
  width: 200px; height: 200px; border-radius: 50%;
  background: rgba(245,166,35,0.06);
}
.calc-expr { font-size: 0.85rem; color: rgba(255,255,255,0.4); font-family: var(--font-mono); min-height: 1.4em; word-break: break-all; text-align: right; }
.calc-result { font-size: 2.2rem; font-weight: 500; color: #fff; font-family: var(--font-mono); word-break: break-all; text-align: right; letter-spacing: -0.03em; font-feature-settings: "tnum" 1, "lnum" 1; }

.calc-buttons {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
}
.calc-btn {
  padding: 1rem; border: none; border-radius: 10px;
  font-family: var(--font-mono); font-size: 1rem; font-weight: 700;
  cursor: pointer; transition: all var(--t);
  background: var(--bg); color: var(--text-primary);
  border: 1.5px solid var(--border);
}
.calc-btn:hover { background: var(--border); transform: translateY(-1px); }
.calc-btn:active { transform: scale(0.96); }
.calc-btn.operator { background: rgba(10,22,40,0.07); color: var(--primary); }
[data-theme="dark"] .calc-btn.operator { background: rgba(245,166,35,0.1); color: var(--accent); }
.calc-btn.equals {
  background: var(--accent); color: #fff;
  border-color: var(--accent);
  box-shadow: 0 4px 16px var(--accent-glow);
}
.calc-btn.equals:hover { background: var(--accent-hover); transform: translateY(-1px); }
.calc-btn.clear { background: rgba(239,68,68,0.1); color: var(--danger); border-color: rgba(239,68,68,0.2); }
.calc-btn.clear:hover { background: var(--danger); color: #fff; }
.calc-btn.special { background: var(--bg-alt); color: var(--text-muted); }
.calc-btn.zero { grid-column: span 2; }

.history-panel { display: flex; flex-direction: column; gap: 0.4rem; max-height: 400px; overflow-y: auto; }
.history-item {
  padding: 0.75rem; border-radius: 8px; background: var(--bg);
  border: 1px solid var(--border); cursor: pointer; transition: all var(--t);
}
.history-item:hover { border-color: var(--accent); background: var(--accent-glow); }
.h-expr { font-size: 0.78rem; color: var(--text-muted); font-family: var(--font-mono); }
.h-result { font-size: 1rem; font-weight: 700; font-family: var(--font-mono); color: var(--text-primary); }

/* === CURRENCY CONVERTER === */
.currency-main-row {
  display: grid; grid-template-columns: 1fr auto 1fr;
  gap: 0.75rem; align-items: end; margin-bottom: 1.25rem;
}
.swap-btn {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--accent); color: #fff;
  border: none; cursor: pointer; font-size: 1.1rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--t); box-shadow: 0 4px 14px var(--accent-glow);
  flex-shrink: 0; margin-bottom: 2px;
}
.swap-btn:hover { transform: rotate(180deg) scale(1.1); }
.big-result {
  font-size: 2.2rem;
  font-weight: 500;
  color: var(--text-primary);
  font-family: var(--font-mono);
  letter-spacing: -0.03em;
  padding: 1rem 0 0.25rem;
  word-break: break-all;
  font-feature-settings: "tnum" 1, "lnum" 1;
}
.last-updated { font-size: 0.78rem; color: var(--text-muted); padding-bottom: 1rem; }
.quick-btns { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.5rem; }
.quick-btn {
  padding: 0.45rem 0.85rem; border-radius: 8px;
  font-family: var(--font); font-size: 0.8rem; font-weight: 700;
  background: var(--bg); border: 1.5px solid var(--border);
  color: var(--text-muted); cursor: pointer; transition: all var(--t);
}
.quick-btn:hover, .quick-btn.active {
  background: var(--accent-glow); border-color: var(--accent); color: var(--text-primary);
}

/* === FOOTER === */
.site-footer {
  background: var(--primary);
  padding: 2.5rem 1.5rem;
  margin-top: auto;
}
[data-theme="dark"] .site-footer { background: #050C1A; border-top: 1px solid rgba(255,255,255,0.05); }
.footer-inner {
  max-width: 1200px; margin: 0 auto;
  display: flex; flex-direction: column; align-items: center; gap: 1.25rem;
  text-align: center;
}
.footer-inner .logo { color: #fff; font-size: 1.1rem; }
.footer-inner .logo span { color: var(--accent); }
.footer-links { display: flex; gap: 1.5rem; flex-wrap: wrap; justify-content: center; }
.footer-links a { font-size: 0.82rem; color: rgba(255,255,255,0.5); font-weight: 600; transition: color var(--t); }
.footer-links a:hover { color: var(--accent); }
.footer-copy { font-size: 0.78rem; color: rgba(255,255,255,0.3); }

/* === RESPONSIVE === */
@media (max-width: 900px) {
  .two-col { grid-template-columns: 1fr; }
  .calc-layout { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .nav-links { display: none; }
  .hamburger { display: flex; }
  .hero { padding: 2.5rem 0 2rem; }
  .hero h1 { font-size: 1.8rem; }
  .extra-results { grid-template-columns: 1fr 1fr; }
  .calc-buttons { gap: 0.35rem; }
  .calc-btn { padding: 0.8rem 0.5rem; font-size: 0.9rem; }
  main { padding: 1.5rem 1rem 3rem; }
}
@media (max-width: 480px) {
  .currency-main-row { grid-template-columns: 1fr auto; }
  .tabs { gap: 0.25rem; }
  .tab-btn { padding: 0.55rem 0.5rem; font-size: 0.75rem; }
  .extra-results { grid-template-columns: 1fr; }
  .affiliate-cards { grid-template-columns: 1fr; }
  .stat-pills { gap: 0.5rem; }
}

/* ===================================================
   PREMIUM UPGRADES — Enhanced visual polish
   =================================================== */

/* Tabular number rendering on all mono elements */
.result-number,
.result-row .value,
.big-result,
.calc-result,
.h-result,
.extra-result-item .val,
td[style*="font-mono"],
.font-mono {
  font-feature-settings: "tnum" 1, "lnum" 1;
}

/* Premium header glass effect enhanced */
.site-header {
  background: rgba(255,255,255,0.88);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
}
[data-theme="dark"] .site-header {
  background: rgba(5,10,20,0.88);
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
}

/* Nav link hover — micro underline effect */
.nav-links a {
  position: relative;
}
.nav-links a::after {
  content: '';
  position: absolute;
  bottom: 0; left: 50%; right: 50%;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
  transition: left 0.2s ease, right 0.2s ease;
  opacity: 0;
}
.nav-links a:hover::after,
.nav-links a.active::after {
  left: 0.85rem; right: 0.85rem;
  opacity: 1;
}

/* Premium stat pills */
.stat-pill {
  transition: transform var(--t), box-shadow var(--t);
}
.stat-pill:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* Table — monospace data cells */
td {
  font-family: var(--font-mono);
  font-feature-settings: "tnum" 1;
  font-size: 0.82rem;
}

/* Rate table in currency — cleaner */
#rate-table td:first-child {
  font-family: var(--font);
  font-weight: 500;
}

/* Premium scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 6px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* Amortization table numbers always tabular */
#amort-tbody td,
#amort-table td {
  font-feature-settings: "tnum" 1, "lnum" 1;
  letter-spacing: -0.01em;
}

/* Currency result section premium */
#result-section {
  background: var(--bg);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  margin-top: 1rem;
  border: 1px solid var(--border);
  transition: background var(--t);
}

/* Quick buttons enhanced */
.quick-btn {
  transition: all var(--t);
  letter-spacing: 0.02em;
}
.quick-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px var(--accent-glow);
}

/* Logo hover */
.logo {
  transition: opacity var(--t);
}
.logo:hover { opacity: 0.85; }

/* Extra smooth focus rings */
input:focus, select:focus, button:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-glow);
}

/* Premium footer */
.site-footer {
  background: linear-gradient(180deg, var(--primary) 0%, #060D1E 100%);
}
[data-theme="dark"] .site-footer {
  background: linear-gradient(180deg, #040A16 0%, #020712 100%);
}

/* Instrument Serif for hero italic */
.hero h1 em {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  font-size: 1.05em;
}
