/* ============================================================
   RinggitWise — Design System
   Palette: Deep Navy #0f2744 | Malaysian Gold #c9a227 | Pearl #f9f7f3
   Fonts: Cormorant Garamond (display) | Plus Jakarta Sans (body)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,500;0,600;0,700;1,400;1,600&family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

/* ---------- CSS Variables ---------- */
:root {
  --navy:        #0f2744;
  --navy-light:  #1a3a5c;
  --navy-dark:   #081929;
  --gold:        #c9a227;
  --gold-light:  #e8c84e;
  --gold-pale:   #fdf4d9;
  --pearl:       #f9f7f3;
  --white:       #ffffff;
  --text:        #1a1a2e;
  --text-muted:  #64748b;
  --text-light:  #94a3b8;
  --border:      #e2ddd6;
  --green:       #10b981;
  --amber:       #f59e0b;
  --red:         #ef4444;
  --shadow-sm:   0 1px 3px rgba(15,39,68,0.08);
  --shadow-md:   0 4px 16px rgba(15,39,68,0.12);
  --shadow-lg:   0 8px 32px rgba(15,39,68,0.16);
  --shadow-gold: 0 4px 24px rgba(201,162,39,0.25);
  --radius:      12px;
  --radius-lg:   20px;
  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-body:    'Plus Jakarta Sans', system-ui, sans-serif;
  --font-mono:    'JetBrains Mono', monospace;
  --transition:   all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---------- Islamic Geometric Pattern SVG (encoded) ---------- */
.geo-pattern {
  background-color: var(--navy-dark);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80'%3E%3Cdefs%3E%3Cpattern id='geo' x='0' y='0' width='80' height='80' patternUnits='userSpaceOnUse'%3E%3Cpath d='M40 0 L80 40 L40 80 L0 40 Z' fill='none' stroke='%23c9a227' stroke-width='0.4' opacity='0.15'/%3E%3Cpath d='M40 10 L70 40 L40 70 L10 40 Z' fill='none' stroke='%23c9a227' stroke-width='0.3' opacity='0.1'/%3E%3Ccircle cx='40' cy='40' r='6' fill='none' stroke='%23c9a227' stroke-width='0.3' opacity='0.12'/%3E%3Cpath d='M40 0 L46 14 L60 10 L54 24 L70 20 L60 32 L80 40 L60 48 L70 60 L54 56 L60 70 L46 66 L40 80 L34 66 L20 70 L26 56 L10 60 L20 48 L0 40 L20 32 L10 20 L26 24 L20 10 L34 14 Z' fill='none' stroke='%23c9a227' stroke-width='0.2' opacity='0.08'/%3E%3C/pattern%3E%3C/defs%3E%3Crect width='80' height='80' fill='url(%23geo)'/%3E%3C/svg%3E");
}

.geo-pattern-light {
  background-color: var(--pearl);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='60'%3E%3Cdefs%3E%3Cpattern id='gl' x='0' y='0' width='60' height='60' patternUnits='userSpaceOnUse'%3E%3Cpath d='M30 0 L60 30 L30 60 L0 30 Z' fill='none' stroke='%23c9a227' stroke-width='0.5' opacity='0.12'/%3E%3Ccircle cx='30' cy='30' r='4' fill='none' stroke='%23c9a227' stroke-width='0.4' opacity='0.1'/%3E%3C/pattern%3E%3C/defs%3E%3Crect width='60' height='60' fill='url(%23gl)'/%3E%3C/svg%3E");
}

/* ---------- Reset & Base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  color: var(--text);
  background: var(--pearl);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .display { font-family: var(--font-display); }

/* ---------- Navigation ---------- */
.navbar {
  background: var(--navy);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 20px rgba(0,0,0,0.3);
}

.navbar-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.logo-icon {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.logo-text {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--white);
  letter-spacing: -0.01em;
}

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

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
}

.nav-links a {
  color: rgba(255,255,255,0.8);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: 8px;
  transition: var(--transition);
  letter-spacing: 0.01em;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--gold);
  background: rgba(201,162,39,0.1);
}

.nav-cta {
  background: var(--gold) !important;
  color: var(--navy) !important;
  font-weight: 700 !important;
  padding: 8px 18px !important;
}

.nav-cta:hover {
  background: var(--gold-light) !important;
  color: var(--navy) !important;
}

.hamburger {
  display: none;
  background: none;
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 4px;
}

/* ---------- Language Switcher ---------- */
.lang-switcher {
  display: flex;
  background: rgba(255,255,255,0.08);
  border-radius: 8px;
  padding: 3px;
  gap: 2px;
  margin-left: 8px;
  flex-shrink: 0;
}

.lang-btn {
  background: transparent;
  border: none;
  color: rgba(255,255,255,0.6);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 9px;
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition);
  font-family: var(--font-body);
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.lang-btn.active {
  background: var(--gold);
  color: var(--navy);
}

.lang-btn:hover:not(.active) { color: var(--gold); }

/* ---------- Retirement-specific ---------- */
.retire-scenario {
  background: var(--white);
  border-radius: var(--radius);
  padding: 16px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--gold);
  margin-bottom: 10px;
}

.retire-scenario h4 {
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--navy);
  margin-bottom: 6px;
}

.retire-scenario p {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.retire-scenario.green { border-left-color: var(--green); }
.retire-scenario.red   { border-left-color: var(--red); }

.progress-bar-wrap {
  background: var(--border);
  border-radius: 999px;
  height: 10px;
  overflow: hidden;
  margin: 8px 0 4px;
}

.progress-bar {
  height: 100%;
  border-radius: 999px;
  transition: width 0.8s cubic-bezier(0.4,0,0.2,1);
}

.progress-bar.green { background: linear-gradient(90deg, var(--green), #34d399); }
.progress-bar.amber { background: linear-gradient(90deg, var(--amber), #fcd34d); }
.progress-bar.red   { background: linear-gradient(90deg, var(--red), #f87171); }

/* Unit Trust / additional invest cards */
.invest-info-box {
  background: var(--gold-pale);
  border: 1px solid rgba(201,162,39,0.25);
  border-radius: var(--radius);
  padding: 14px 16px;
  font-size: 0.85rem;
  color: var(--navy);
  line-height: 1.6;
  margin-top: 12px;
}

.invest-info-box strong { color: var(--gold); }

/* ---------- Page Layout ---------- */
.page-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
}

.content-grid {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 32px;
  align-items: start;
}

/* ---------- Hero Section ---------- */
.hero {
  position: relative;
  overflow: hidden;
  padding: 80px 0 100px;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--navy-dark) 0%, var(--navy) 50%, var(--navy-light) 100%);
}

.hero-geo {
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='100'%3E%3Cdefs%3E%3Cpattern id='h' x='0' y='0' width='100' height='100' patternUnits='userSpaceOnUse'%3E%3Cpath d='M50 0 L100 50 L50 100 L0 50 Z' fill='none' stroke='%23c9a227' stroke-width='0.6' opacity='0.12'/%3E%3Cpath d='M50 15 L85 50 L50 85 L15 50 Z' fill='none' stroke='%23c9a227' stroke-width='0.4' opacity='0.08'/%3E%3Ccircle cx='50' cy='50' r='8' fill='none' stroke='%23c9a227' stroke-width='0.4' opacity='0.1'/%3E%3C/pattern%3E%3C/defs%3E%3Crect width='100' height='100' fill='url(%23h)'/%3E%3C/svg%3E");
  opacity: 0.6;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(201,162,39,0.15);
  border: 1px solid rgba(201,162,39,0.3);
  color: var(--gold-light);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 20px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.8rem);
  font-weight: 700;
  color: var(--white);
  line-height: 1.15;
  margin-bottom: 20px;
  letter-spacing: -0.02em;
}

.hero h1 em {
  color: var(--gold);
  font-style: italic;
}

.hero-sub {
  font-size: 1.1rem;
  color: rgba(255,255,255,0.75);
  max-width: 560px;
  line-height: 1.7;
  margin-bottom: 36px;
}

.hero-stats {
  display: flex;
  gap: 32px;
  flex-wrap: wrap;
  margin-bottom: 40px;
}

.stat {
  display: flex;
  flex-direction: column;
}

.stat-num {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--gold);
  line-height: 1;
}

.stat-label {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.6);
  margin-top: 4px;
  letter-spacing: 0.02em;
}

.btn-group {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  color: var(--navy-dark);
  font-weight: 700;
  font-size: 0.95rem;
  padding: 14px 28px;
  border-radius: 10px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: var(--shadow-gold);
  font-family: var(--font-body);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(201,162,39,0.4);
}

.btn-outline {
  background: transparent;
  color: var(--white);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 13px 28px;
  border-radius: 10px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(255,255,255,0.3);
  cursor: pointer;
  transition: var(--transition);
  font-family: var(--font-body);
}

.btn-outline:hover {
  border-color: var(--gold);
  color: var(--gold);
}

/* ---------- Ad Slot Styles ---------- */
.ad-slot {
  background: linear-gradient(135deg, #f0f4f8, #e8edf3);
  border: 2px dashed #c5cfd9;
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-light);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  gap: 6px;
  position: relative;
  overflow: hidden;
}

.ad-slot::before {
  content: 'Advertisement';
  font-size: 0.65rem;
  color: var(--text-light);
  letter-spacing: 0.08em;
}

.ad-leaderboard { width: 100%; height: 90px; margin: 16px 0; }
.ad-rectangle { width: 300px; height: 250px; }
.ad-sidebar { width: 100%; height: 600px; }
.ad-mobile { width: 100%; height: 50px; position: fixed; bottom: 0; left: 0; z-index: 90; border-radius: 0; display: none; }

/* ---------- Section Headers ---------- */
.section-header {
  text-align: center;
  margin-bottom: 48px;
}

.section-tag {
  display: inline-block;
  background: var(--gold-pale);
  color: var(--gold);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 5px 14px;
  border-radius: 999px;
  margin-bottom: 12px;
  border: 1px solid rgba(201,162,39,0.2);
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3vw, 2.5rem);
  font-weight: 700;
  color: var(--navy);
  line-height: 1.2;
  margin-bottom: 12px;
}

.section-sub {
  font-size: 1rem;
  color: var(--text-muted);
  max-width: 560px;
  margin: 0 auto;
}

/* ---------- Cards ---------- */
.card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  transition: var(--transition);
}

.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.card-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.card-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.calc-card-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--navy), var(--navy-light));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}

.calc-card-icon.gold-bg {
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
}

/* ---------- Calculator UI ---------- */
.calculator-section {
  padding: 40px 0 80px;
}

.calc-tabs {
  display: flex;
  gap: 4px;
  background: var(--navy-dark);
  padding: 6px;
  border-radius: 14px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.calc-tab {
  flex: 1;
  min-width: 120px;
  padding: 10px 14px;
  background: transparent;
  border: none;
  color: rgba(255,255,255,0.6);
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 600;
  border-radius: 10px;
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
  white-space: nowrap;
}

.calc-tab:hover { color: var(--gold); }
.calc-tab.active {
  background: var(--white);
  color: var(--navy);
  box-shadow: var(--shadow-sm);
}

.calc-panel { display: none; }
.calc-panel.active { display: block; }

.calc-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.calc-header {
  background: linear-gradient(135deg, var(--navy), var(--navy-light));
  padding: 24px 28px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.calc-header-icon {
  width: 46px;
  height: 46px;
  background: rgba(201,162,39,0.2);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.calc-header h2 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  color: var(--white);
  font-weight: 600;
}

.calc-header p {
  font-size: 0.82rem;
  color: rgba(255,255,255,0.65);
  margin-top: 2px;
}

.calc-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}

.calc-inputs {
  padding: 28px;
  border-right: 1px solid var(--border);
}

.calc-results {
  padding: 28px;
  background: var(--pearl);
}

.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 8px;
  letter-spacing: 0.01em;
}

.form-label span {
  color: var(--text-muted);
  font-weight: 400;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-prefix,
.input-suffix {
  position: absolute;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  pointer-events: none;
}

.input-prefix { left: 14px; }
.input-suffix { right: 14px; }

.form-input {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--text);
  background: var(--white);
  transition: var(--transition);
  outline: none;
}

.form-input:focus {
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(15,39,68,0.08);
}

.form-input.has-prefix { padding-left: 48px; }
.form-input.has-suffix { padding-right: 48px; }

.form-select {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--text);
  background: var(--white);
  cursor: pointer;
  outline: none;
  appearance: none;
  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='%2364748b' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  transition: var(--transition);
}

.form-select:focus {
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(15,39,68,0.08);
}

input[type="range"] {
  width: 100%;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  outline: none;
  cursor: pointer;
  margin-top: 8px;
  accent-color: var(--navy);
}

.btn-calculate {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, var(--navy), var(--navy-light));
  color: var(--white);
  border: none;
  border-radius: 10px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  margin-top: 8px;
  letter-spacing: 0.02em;
}

.btn-calculate:hover {
  background: linear-gradient(135deg, var(--navy-dark), var(--navy));
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-calculate.gold {
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  color: var(--navy-dark);
}

.btn-calculate.gold:hover {
  box-shadow: var(--shadow-gold);
}

/* ---------- Result Display ---------- */
.result-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 200px;
  color: var(--text-muted);
  text-align: center;
}

.result-empty svg { opacity: 0.3; margin-bottom: 12px; }

.result-main {
  text-align: center;
  padding: 20px;
  background: linear-gradient(135deg, var(--navy-dark), var(--navy));
  border-radius: var(--radius);
  margin-bottom: 16px;
  color: var(--white);
}

.result-label {
  font-size: 0.78rem;
  color: rgba(255,255,255,0.65);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 6px;
}

.result-value {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--gold);
  line-height: 1;
}

.result-sub {
  font-size: 0.82rem;
  color: rgba(255,255,255,0.6);
  margin-top: 4px;
}

.result-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}

.result-item {
  background: var(--white);
  border-radius: 10px;
  padding: 14px;
  border: 1px solid var(--border);
}

.result-item-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 4px;
}

.result-item-value {
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--navy);
}

.result-item-value.green { color: var(--green); }
.result-item-value.amber { color: var(--amber); }
.result-item-value.red   { color: var(--red); }

/* ---------- Quick Answer Box (AISEO) ---------- */
.quick-answer {
  background: linear-gradient(135deg, #fffbeb, #fef3c7);
  border-left: 4px solid var(--gold);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 18px 20px;
  margin-bottom: 28px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.quick-answer-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
  margin-top: 2px;
}

.quick-answer-body strong {
  display: block;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gold);
  margin-bottom: 4px;
}

.quick-answer-body p {
  font-size: 0.92rem;
  color: var(--text);
  line-height: 1.6;
}

/* ---------- Bank Comparison Table ---------- */
.bank-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.bank-table th {
  background: var(--navy);
  color: var(--white);
  padding: 12px 16px;
  text-align: left;
  font-weight: 600;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.bank-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}

.bank-table tr:last-child td { border-bottom: none; }
.bank-table tr:nth-child(even) td { background: var(--pearl); }
.bank-table tr:hover td { background: var(--gold-pale); }

.badge-best {
  background: var(--gold-pale);
  color: var(--gold);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(201,162,39,0.3);
  margin-left: 6px;
}

.badge-islamic {
  background: #e0f2fe;
  color: #0369a1;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid #bae6fd;
  margin-left: 6px;
}

/* ---------- Amortization Table ---------- */
.amort-wrapper {
  max-height: 280px;
  overflow-y: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin-top: 16px;
  scrollbar-width: thin;
  scrollbar-color: var(--gold) var(--border);
}

.amort-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
  font-family: var(--font-mono);
}

.amort-table th {
  position: sticky;
  top: 0;
  background: var(--navy);
  color: var(--white);
  padding: 10px 12px;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-align: right;
  font-family: var(--font-body);
  font-weight: 600;
  text-transform: uppercase;
}

.amort-table th:first-child { text-align: center; }

.amort-table td {
  padding: 8px 12px;
  text-align: right;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}

.amort-table td:first-child { text-align: center; color: var(--text-muted); }
.amort-table tr:nth-child(even) td { background: var(--pearl); }

/* ---------- DSR Meter ---------- */
.dsr-meter {
  margin: 16px 0;
}

.dsr-bar-wrap {
  background: var(--border);
  border-radius: 999px;
  height: 14px;
  overflow: hidden;
  position: relative;
  margin-bottom: 8px;
}

.dsr-bar {
  height: 100%;
  border-radius: 999px;
  transition: width 0.6s cubic-bezier(0.4,0,0.2,1);
  position: relative;
}

.dsr-bar.green  { background: linear-gradient(90deg, var(--green), #34d399); }
.dsr-bar.amber  { background: linear-gradient(90deg, var(--amber), #fcd34d); }
.dsr-bar.red    { background: linear-gradient(90deg, var(--red), #f87171); }

.dsr-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.dsr-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 999px;
  margin-top: 8px;
}

.dsr-status.green { background: #d1fae5; color: #065f46; }
.dsr-status.amber { background: #fef3c7; color: #92400e; }
.dsr-status.red   { background: #fee2e2; color: #991b1b; }

/* ---------- Toggle (Islamic / Conventional) ---------- */
.finance-toggle {
  display: flex;
  background: var(--pearl);
  border-radius: 10px;
  padding: 4px;
  border: 1px solid var(--border);
  margin-bottom: 20px;
}

.finance-toggle button {
  flex: 1;
  padding: 8px 16px;
  border: none;
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  background: transparent;
  color: var(--text-muted);
}

.finance-toggle button.active {
  background: var(--navy);
  color: var(--white);
}

.finance-toggle button.active.islamic {
  background: linear-gradient(135deg, #0369a1, #0284c7);
}

/* ---------- Chart Container ---------- */
.chart-container {
  position: relative;
  background: var(--white);
  border-radius: var(--radius);
  padding: 20px;
  border: 1px solid var(--border);
  margin-top: 16px;
}

.chart-container canvas {
  max-height: 280px;
}

/* ---------- FAQ Section ---------- */
.faq-section { padding: 60px 0; }

.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 8px;
  overflow: hidden;
  background: var(--white);
}

.faq-question {
  padding: 18px 20px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--navy);
  transition: var(--transition);
  border: none;
  width: 100%;
  background: transparent;
  font-family: var(--font-body);
  text-align: left;
}

.faq-question:hover { color: var(--gold); }

.faq-question svg {
  flex-shrink: 0;
  transition: transform 0.25s ease;
  color: var(--text-muted);
}

.faq-item.open .faq-question svg { transform: rotate(180deg); }
.faq-item.open .faq-question { color: var(--navy); border-bottom: 1px solid var(--border); }

.faq-answer {
  padding: 0 20px;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease, padding 0.25s ease;
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.7;
}

.faq-item.open .faq-answer {
  max-height: 400px;
  padding: 16px 20px;
}

/* ---------- Trust Badges ---------- */
.trust-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 40px;
  padding: 20px 24px;
  background: var(--white);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.trust-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 500;
}

.trust-item svg { color: var(--green); flex-shrink: 0; }

/* ---------- Blog ---------- */
.blog-body {
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 32px 36px;
  line-height: 1.8;
  color: var(--text);
}

.blog-body h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--navy);
  margin: 32px 0 14px;
  font-weight: 600;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--gold-pale);
}

.blog-body h2:first-child { margin-top: 0; }

.blog-body h3 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: var(--navy);
  margin: 24px 0 10px;
  font-weight: 600;
}

.blog-body p {
  margin-bottom: 16px;
  font-size: 0.95rem;
  line-height: 1.8;
}

.blog-body ul, .blog-body ol {
  padding-left: 20px;
  margin-bottom: 16px;
}

.blog-body li {
  margin-bottom: 8px;
  font-size: 0.95rem;
  line-height: 1.7;
}

.blog-body strong { color: var(--navy); }

.blog-body a {
  color: var(--navy);
  text-decoration: none;
  border-bottom: 1.5px solid var(--gold);
  transition: var(--transition);
}
.blog-body a:hover { color: var(--gold); }

.blog-calc-link {
  background: var(--gold-pale);
  border: 1px solid rgba(201,162,39,0.4) !important;
  border-radius: 4px;
  padding: 1px 7px;
  font-weight: 600;
  color: var(--navy) !important;
  white-space: nowrap;
}
.blog-calc-link:hover { background: var(--gold) !important; color: var(--navy) !important; }

.blog-callout {
  background: linear-gradient(135deg, var(--gold-pale), #fff8dc);
  border-left: 4px solid var(--gold);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 18px 20px;
  margin: 24px 0;
  font-size: 0.9rem;
  color: var(--text);
}

.blog-callout strong {
  display: block;
  margin-bottom: 6px;
  color: var(--navy);
  font-size: 0.95rem;
}

.blog-body .bank-table {
  width: 100%;
  margin: 20px 0;
}

@media (max-width: 900px) {
  .blog-body {
    padding: 20px 18px;
  }
}

/* ---------- Footer ---------- */
.footer {
  background: var(--navy-dark);
  color: rgba(255,255,255,0.7);
  padding: 56px 0 24px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}

.footer h4 {
  color: var(--white);
  font-weight: 700;
  font-size: 0.875rem;
  margin-bottom: 14px;
  letter-spacing: 0.02em;
}

.footer a {
  color: rgba(255,255,255,0.6);
  text-decoration: none;
  font-size: 0.85rem;
  display: block;
  margin-bottom: 8px;
  transition: var(--transition);
}

.footer a:hover { color: var(--gold); }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
  flex-wrap: wrap;
  gap: 8px;
}

.footer-disclaimer {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.4);
  max-width: 600px;
  line-height: 1.6;
  margin-top: 16px;
}

/* ---------- Page Hero (inner pages) ---------- */
.page-hero {
  background: linear-gradient(135deg, var(--navy-dark), var(--navy));
  padding: 48px 0;
  position: relative;
  overflow: hidden;
}

.page-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='60'%3E%3Cdefs%3E%3Cpattern id='p' x='0' y='0' width='60' height='60' patternUnits='userSpaceOnUse'%3E%3Cpath d='M30 0 L60 30 L30 60 L0 30 Z' fill='none' stroke='%23c9a227' stroke-width='0.5' opacity='0.12'/%3E%3C/pattern%3E%3C/defs%3E%3Crect width='60' height='60' fill='url(%23p)'/%3E%3C/svg%3E");
}

.page-hero-content {
  position: relative;
  z-index: 1;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  font-size: 0.8rem;
}

.breadcrumb a { color: rgba(255,255,255,0.5); text-decoration: none; }
.breadcrumb a:hover { color: var(--gold); }
.breadcrumb span { color: rgba(255,255,255,0.3); }
.breadcrumb strong { color: var(--gold); }

.page-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3.5vw, 2.8rem);
  font-weight: 700;
  color: var(--white);
  line-height: 1.2;
  margin-bottom: 10px;
}

.page-hero p {
  font-size: 1rem;
  color: rgba(255,255,255,0.7);
  max-width: 560px;
}

/* ---------- Glossary ---------- */
.glossary-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.glossary-item {
  background: var(--white);
  border-radius: var(--radius);
  padding: 18px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--gold);
}

.glossary-term {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--navy);
  margin-bottom: 4px;
}

.glossary-def {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ---------- Rate Watch Table ---------- */
.rate-table {
  width: 100%;
  border-collapse: collapse;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  font-size: 0.875rem;
}

.rate-table th {
  background: var(--navy);
  color: var(--white);
  padding: 12px 16px;
  text-align: left;
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.rate-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

.rate-table tr:last-child td { border-bottom: none; }
.rate-table tr:nth-child(even) td { background: var(--pearl); }

.rate-up   { color: var(--red); }
.rate-down { color: var(--green); }
.rate-flat { color: var(--text-muted); }

/* ---------- Insurance Provider Cards ---------- */
.provider-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-top: 20px;
}

.provider-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 20px;
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.provider-name {
  font-weight: 700;
  color: var(--navy);
  font-size: 0.95rem;
}

.provider-type {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.btn-quote {
  width: 100%;
  padding: 10px;
  background: var(--gold-pale);
  border: 1px solid var(--gold);
  color: var(--gold);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.82rem;
  border-radius: 8px;
  cursor: pointer;
  transition: var(--transition);
  letter-spacing: 0.02em;
}

.btn-quote:hover {
  background: var(--gold);
  color: var(--navy);
}

/* ---------- Faraid Toggle ---------- */
.faraid-section { margin-top: 24px; }

.distribution-bar {
  display: flex;
  border-radius: 10px;
  overflow: hidden;
  height: 40px;
  margin: 16px 0;
}

.dist-segment {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
  color: white;
  transition: width 0.5s ease;
}

/* ---------- Asset Comparison ---------- */
.asset-legend {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

/* ---------- Guides Cards ---------- */
.guide-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: var(--transition);
}

.guide-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.guide-card-img {
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
}

.guide-card-body { padding: 20px; }

.guide-tag {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 999px;
  margin-bottom: 8px;
}

.guide-tag.beginner { background: #d1fae5; color: #065f46; }
.guide-tag.popular  { background: #fef3c7; color: #92400e; }
.guide-tag.islamic  { background: #e0f2fe; color: #0369a1; }

/* ---------- Utility ---------- */
.section-py { padding: 60px 0; }
.section-py-sm { padding: 40px 0; }
.mt-4  { margin-top: 16px; }
.mt-6  { margin-top: 24px; }
.mt-8  { margin-top: 32px; }
.mb-4  { margin-bottom: 16px; }
.mb-6  { margin-bottom: 24px; }
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 0.875rem; }

.divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border), transparent);
  margin: 40px 0;
}

/* ---------- Animate ---------- */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes countUp {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.animate-fade-up {
  animation: fadeUp 0.6s cubic-bezier(0.4,0,0.2,1) forwards;
}

.result-value { animation: countUp 0.4s ease forwards; }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .content-grid { grid-template-columns: 1fr; }
  .footer-grid  { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  .nav-links { display: none; }
  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 68px;
    left: 0;
    right: 0;
    background: var(--navy);
    padding: 16px;
    gap: 4px;
    box-shadow: var(--shadow-lg);
  }
  .hamburger { display: flex; }
  .calc-body { grid-template-columns: 1fr; }
  .calc-inputs { border-right: none; border-bottom: 1px solid var(--border); }
  .card-grid-3 { grid-template-columns: 1fr; }
  .card-grid-2 { grid-template-columns: 1fr; }
  .hero-stats  { gap: 20px; }
  .footer-grid { grid-template-columns: 1fr; gap: 24px; }
  .glossary-grid { grid-template-columns: 1fr; }
  .provider-grid { grid-template-columns: 1fr; }
  .result-grid { grid-template-columns: 1fr; }
  .calc-tabs { flex-direction: column; }
  .calc-tab { flex: none; text-align: left; }
  .ad-mobile { display: flex; }
  body { padding-bottom: 60px; }
}
