/* ─────────────────────────────────────────────────────────────────────────
   Currency.tn — Main Stylesheet
   ───────────────────────────────────────────────────────────────────────── */

/* ── Design Tokens ───────────────────────────────────────── */
:root {
  /* Brand */
  --brand-primary:   #1a56db;
  --brand-hover:     #1648c7;
  --brand-light:     #eff6ff;
  --brand-glow:      rgba(26,86,219,.12);

  /* Neutrals */
  --color-bg:        #f8fafc;
  --color-surface:   #ffffff;
  --color-surface2:  #f1f5f9;
  --color-border:    #e2e8f0;
  --color-border2:   #cbd5e1;
  --color-text:      #0f172a;
  --color-muted:     #64748b;
  --color-subtle:    #94a3b8;

  /* Semantic */
  --color-green:     #10b981;
  --color-green-bg:  #ecfdf5;
  --color-red:       #ef4444;
  --color-red-bg:    #fef2f2;
  --color-amber:     #f59e0b;
  --color-amber-bg:  #fffbeb;
  --color-hover:     #f1f5f9;

  /* Sizing */
  --radius-sm:  6px;
  --radius:     10px;
  --radius-lg:  16px;
  --radius-xl:  24px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm:  0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow:     0 4px 16px rgba(0,0,0,.07), 0 1px 4px rgba(0,0,0,.04);
  --shadow-lg:  0 12px 40px rgba(0,0,0,.10), 0 2px 8px rgba(0,0,0,.05);
  --shadow-xl:  0 24px 60px rgba(0,0,0,.14);

  /* Typography */
  --font-sans:    'DM Sans', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-display: 'Sora', 'Inter', sans-serif;
  --font-mono:    'JetBrains Mono', 'Fira Code', monospace;

  /* Curravo brand palette (oklch) */
  --crv-navy:         oklch(0.22 0.06 258);
  --crv-navy-mid:     oklch(0.30 0.07 258);
  --crv-green:        oklch(0.58 0.17 165);
  --crv-green-light:  oklch(0.94 0.06 165);
  --crv-teal:         oklch(0.60 0.16 200);
  --crv-teal-light:   oklch(0.94 0.05 200);
  --crv-amber:        oklch(0.72 0.15 75);
  --crv-amber-light:  oklch(0.96 0.05 80);
  --crv-radius-sm:    8px;
  --crv-radius-md:    14px;
  --crv-radius-lg:    20px;
  --crv-radius-xl:    28px;

  /* Layout */
  --container: 1200px;
  --header-h:  64px;

  /* Transitions */
  --ease: cubic-bezier(.4,0,.2,1);
  --dur:  200ms;
}

/* Shorthand aliases used by account/component pages (var(--surface,#fff) etc.) */
:root {
  --surface:    var(--color-surface);
  --surface2:   var(--color-surface2);
  --bg:         var(--color-bg);
  --text:       var(--color-text);
  --text-muted: var(--color-muted);
  --border:     var(--color-border);
  --primary:    var(--brand-primary);
}

/* Dark mode */
[data-theme="dark"] {
  --color-bg:       #0b1120;
  --color-surface:  #141c2f;
  --color-surface2: #1a2540;
  --color-border:   #1e2d45;
  --color-border2:  #263553;
  --color-text:     #f1f5f9;
  --color-muted:    #94a3b8;
  --color-subtle:   #64748b;
  --brand-light:    rgba(26,86,219,.18);
  --brand-glow:     rgba(26,86,219,.20);
  --shadow:         0 4px 16px rgba(0,0,0,.3);
  --shadow-lg:      0 12px 40px rgba(0,0,0,.4);
  --shadow-xl:      0 24px 60px rgba(0,0,0,.5);
  --color-green-bg: rgba(16,185,129,.12);
  --color-red-bg:   rgba(239,68,68,.12);
  --color-amber-bg: rgba(245,158,11,.12);
  --color-hover:    var(--color-surface2);
  /* Shorthand aliases — must mirror root aliases so account pages respond */
  --surface:    var(--color-surface);
  --surface2:   var(--color-surface2);
  --bg:         var(--color-bg);
  --text:       var(--color-text);
  --text-muted: var(--color-muted);
  --border:     var(--color-border);
}

/* ── Reset ────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; -webkit-text-size-adjust: 100%; overflow-x: hidden; }
body {
  font-family: var(--font-sans);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; background: none; font: inherit; }
ul, ol { list-style: none; }
input, select, textarea { font: inherit; }
table { border-collapse: collapse; }

/* ── Utilities ────────────────────────────────────────────── */
.container { max-width: var(--container); margin: 0 auto; padding: 0 1.25rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
.skip-link { position: absolute; top: -9999px; left: 1rem; padding: .5rem 1rem; background: var(--brand-primary); color: #fff; border-radius: var(--radius); z-index: 9999; }
.skip-link:focus { top: 1rem; }
.text-green  { color: var(--color-green); }
.text-red    { color: var(--color-red); }
.text-muted  { color: var(--color-muted); }
.text-mono   { font-family: var(--font-mono); }
.badge {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .2rem .6rem;
  font-size: .75rem; font-weight: 600; line-height: 1.4;
  border-radius: var(--radius-full);
}
.badge-green  { background: var(--color-green-bg);  color: var(--color-green); }
.badge-red    { background: var(--color-red-bg);    color: var(--color-red); }
.badge-amber  { background: var(--color-amber-bg);  color: var(--color-amber); }
.badge-blue   { background: var(--brand-light);     color: var(--brand-primary); }
.badge-neutral{ background: var(--color-surface2);  color: var(--color-muted); }

/* ── Buttons ──────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  padding: .6rem 1.25rem;
  font-size: .9rem; font-weight: 600; line-height: 1;
  border-radius: var(--radius);
  transition: background var(--dur) var(--ease), box-shadow var(--dur) var(--ease), transform 80ms var(--ease), opacity var(--dur) var(--ease);
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand-primary); color: #fff; }
.btn-primary:hover { background: var(--brand-hover); box-shadow: 0 4px 16px var(--brand-glow); }
.btn-secondary { background: var(--color-surface2); color: var(--color-text); border: 1px solid var(--color-border); }
.btn-secondary:hover { background: var(--color-border); }
.btn-ghost { color: var(--color-muted); }
.btn-ghost:hover { color: var(--color-text); background: var(--color-surface2); }
.btn-danger { background: var(--color-red-bg); color: var(--color-red); border: 1px solid rgba(239,68,68,.2); }
.btn-danger:hover { background: var(--color-red); color: #fff; }
.btn-lg { padding: .8rem 1.75rem; font-size: 1rem; border-radius: var(--radius-lg); }
.btn-sm { padding: .35rem .9rem; font-size: .8rem; border-radius: var(--radius-sm); }
.btn-icon { padding: .55rem; border-radius: var(--radius); aspect-ratio: 1; }
.btn:disabled { opacity: .5; pointer-events: none; }

/* ── Card ─────────────────────────────────────────────────── */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.card-padded { padding: 1.5rem; }
.card-hover { transition: box-shadow var(--dur) var(--ease), transform var(--dur) var(--ease); }
.card-hover:hover { box-shadow: var(--shadow); transform: translateY(-2px); }

/* ── Forms ────────────────────────────────────────────────── */
.form-label { display: block; font-size: .85rem; font-weight: 600; color: var(--color-muted); margin-bottom: .4rem; letter-spacing: .02em; text-transform: uppercase; }
.form-input, .form-select {
  width: 100%; padding: .7rem 1rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border2);
  border-radius: var(--radius);
  color: var(--color-text);
  font-size: .95rem;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
  -webkit-appearance: none;
}
.form-input:focus, .form-select:focus { outline: none; border-color: var(--brand-primary); box-shadow: 0 0 0 3px var(--brand-glow); }
.form-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='%2364748b' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right .9rem center; padding-right: 2.5rem; cursor: pointer; }

/* ── Header ───────────────────────────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 100;
  height: var(--header-h);
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(12px) saturate(1.5);
  border-bottom: 1px solid var(--color-border);
  transition: box-shadow var(--dur) var(--ease);
}
[data-theme="dark"] .site-header {
  background: rgba(11,17,32,.92);
}
.site-header.scrolled { box-shadow: var(--shadow-sm); }
.header-inner {
  height: 100%;
  display: flex; align-items: center; gap: 1.5rem;
}
.site-logo {
  display: flex; align-items: center; gap: .55rem;
  font-size: 1.15rem; font-weight: 800;
  color: var(--color-text);
  letter-spacing: -.02em;
  flex-shrink: 0;
}
.logo-icon { color: var(--brand-primary); }
.logo-dot { color: var(--brand-primary); }

.primary-nav { flex: 1; }
.nav-list { display: flex; align-items: center; gap: .25rem; }
.nav-link {
  display: flex; align-items: center;
  padding: .45rem .8rem;
  font-size: .88rem; font-weight: 500;
  color: var(--color-muted);
  border-radius: var(--radius);
  transition: color var(--dur), background var(--dur);
}
.nav-link:hover, .nav-link.active { color: var(--color-text); background: var(--color-surface2); }
.nav-link.active { color: var(--brand-primary); }

.header-actions { display: flex; align-items: center; gap: .5rem; margin-left: auto; flex-shrink: 0; }
.btn-theme-toggle {
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px;
  border-radius: var(--radius);
  color: var(--color-muted);
  transition: color var(--dur), background var(--dur);
}
.btn-theme-toggle:hover { color: var(--color-text); background: var(--color-surface2); }
[data-theme="light"] .icon-moon { display: none; }
[data-theme="dark"]  .icon-sun  { display: none; }

.hamburger { display: none; flex-direction: column; gap: 5px; padding: .5rem; border-radius: var(--radius); flex-shrink: 0; }
.hamburger span { display: block; width: 20px; height: 2px; background: var(--color-text); border-radius: 2px; transition: transform var(--dur) var(--ease), opacity var(--dur) var(--ease); }
.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 auth list item: hidden on desktop, visible inside mobile dropdown */
.nav-mobile-auth { display: none; }


/* ── Hero ─────────────────────────────────────────────────── */
.hero {
  background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 50%, #1a56db 100%);
  padding: 4rem 0 3rem;
  position: relative; overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse 80% 60% at 60% 40%, rgba(99,160,255,.18) 0%, transparent 70%);
  pointer-events: none;
}
.hero-inner { position: relative; z-index: 1; text-align: center; }
.hero-tag {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .3rem .9rem; margin-bottom: 1.25rem;
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.15);
  border-radius: var(--radius-full);
  font-size: .8rem; font-weight: 600; color: rgba(255,255,255,.85);
  letter-spacing: .04em; text-transform: uppercase;
}
.hero-tag-dot {
  width: 6px; height: 6px;
  background: var(--color-green);
  border-radius: 50%;
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse { 0%,100%{opacity:1;transform:scale(1)} 50%{opacity:.5;transform:scale(1.3)} }
.hero h1 { font-size: clamp(1.8rem, 4vw, 2.75rem); font-weight: 800; color: #fff; letter-spacing: -.03em; line-height: 1.15; margin-bottom: .75rem; }
.hero p { font-size: 1rem; color: rgba(255,255,255,.7); max-width: 520px; margin: 0 auto 2rem; }

/* ── Converter Widget ─────────────────────────────────────── */
.converter-card {
  background: var(--color-surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  padding: 2rem;
  max-width: 780px;
  margin: 0 auto;
  border: 1px solid var(--color-border);
}
/* Amount row */
.conv-amount-row { margin-bottom: 1rem; }
.conv-label { display: block; font-size: .78rem; font-weight: 700; color: var(--color-muted); letter-spacing: .06em; text-transform: uppercase; margin-bottom: .5rem; }
/* Selectors row: [from] [swap] [to] */
.conv-selectors-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: .75rem;
  margin-bottom: 1.25rem;
}
/* Legacy class kept for JS compatibility */
.converter-fields { display: none; }
.converter-field { display: flex; flex-direction: column; gap: .5rem; }
.converter-field label { font-size: .78rem; font-weight: 700; color: var(--color-muted); letter-spacing: .06em; text-transform: uppercase; }
.converter-amount {
  font-size: 1.5rem; font-weight: 700;
  padding: .8rem 1rem;
  border: 2px solid var(--color-border2);
  border-radius: var(--radius);
  background: var(--color-surface);
  color: var(--color-text);
  width: 100%; transition: border-color var(--dur);
}
.converter-amount:focus { outline: none; border-color: var(--brand-primary); }
.currency-selector {
  display: flex; align-items: center; gap: .5rem;
  padding: .8rem 1rem;
  border: 2px solid var(--color-border2);
  border-radius: var(--radius);
  background: var(--color-surface);
  cursor: pointer; transition: border-color var(--dur), box-shadow var(--dur);
  min-width: 0;
}
.currency-selector:hover { border-color: var(--color-border2); background: var(--color-surface2); }
.currency-selector.open { border-color: var(--brand-primary); box-shadow: 0 0 0 3px var(--brand-glow); }
.flag-emoji { font-size: 1.3rem; line-height: 1; flex-shrink: 0; }
.currency-code { font-size: 1.1rem; font-weight: 700; }
.currency-name-small { font-size: .78rem; color: var(--color-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.selector-caret { margin-left: auto; color: var(--color-subtle); flex-shrink: 0; }
.swap-btn {
  width: 40px; height: 40px;
  border-radius: var(--radius);
  background: var(--color-surface2);
  border: 1px solid var(--color-border);
  color: var(--color-muted);
  display: flex; align-items: center; justify-content: center;
  transition: background var(--dur), color var(--dur), transform var(--dur);
  flex-shrink: 0; margin-bottom: .4rem;
}
.swap-btn:hover { background: var(--brand-primary); color: #fff; transform: rotate(180deg); }

.converter-result {
  padding: 1.25rem 1rem;
  background: var(--brand-light);
  border-radius: var(--radius);
  text-align: center;
  margin-bottom: 1.25rem;
}
.result-amount {
  font-size: 2rem; font-weight: 800;
  color: var(--brand-primary);
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}
.result-label { font-size: .85rem; color: var(--color-muted); margin-top: .25rem; }
.result-meta {
  display: flex; justify-content: center; gap: 1.5rem;
  margin-top: .75rem; padding-top: .75rem;
  border-top: 1px solid var(--color-border);
  font-size: .82rem; color: var(--color-muted);
}
.result-meta span strong { color: var(--color-text); }

.converter-actions { display: flex; gap: .75rem; }
.converter-actions .btn { flex: 1; }

/* Currency Search Dropdown */
.currency-dropdown {
  position: absolute;
  z-index: 200;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 320px;
  max-height: 400px;
  display: flex; flex-direction: column;
  overflow: hidden;
}
.currency-search-wrap { padding: .75rem; border-bottom: 1px solid var(--color-border); }
.currency-search {
  width: 100%; padding: .55rem .9rem;
  border: 1px solid var(--color-border2);
  border-radius: var(--radius);
  background: var(--color-surface2);
  color: var(--color-text); font-size: .9rem;
}
.currency-search:focus { outline: none; border-color: var(--brand-primary); }
.currency-list { flex: 1; overflow-y: auto; padding: .4rem; }
.currency-group-label { padding: .4rem .6rem; font-size: .72rem; font-weight: 700; color: var(--color-subtle); letter-spacing: .08em; text-transform: uppercase; }
.currency-option {
  display: flex; align-items: center; gap: .65rem;
  padding: .55rem .6rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--dur);
}
.currency-option:hover, .currency-option.focused { background: var(--color-surface2); }
.currency-option.selected { background: var(--brand-light); }
.currency-option-name { font-size: .85rem; color: var(--color-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ── Rate Table ───────────────────────────────────────────── */
.rate-section { padding: 3rem 0; }
.section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1.5rem; gap: 1rem; flex-wrap: wrap;
}
.section-title { font-size: 1.3rem; font-weight: 800; letter-spacing: -.02em; }
.section-subtitle { font-size: .85rem; color: var(--color-muted); margin-top: .2rem; }

.rate-filter-tabs {
  display: flex; gap: .35rem;
  background: var(--color-surface2);
  border-radius: var(--radius);
  padding: .3rem;
}
.tab-btn {
  padding: .4rem .9rem;
  font-size: .82rem; font-weight: 600;
  border-radius: var(--radius-sm);
  color: var(--color-muted);
  transition: background var(--dur), color var(--dur);
}
.tab-btn:hover { color: var(--color-text); }
.tab-btn.active { background: var(--color-surface); color: var(--brand-primary); box-shadow: var(--shadow-sm); }

.rate-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: .75rem;
}
.rate-card {
  display: flex; align-items: center; justify-content: space-between;
  padding: .9rem 1rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  transition: box-shadow var(--dur), border-color var(--dur), transform var(--dur);
  cursor: pointer;
  text-decoration: none; color: inherit;
}
.rate-card:hover { box-shadow: var(--shadow); border-color: var(--color-border2); transform: translateY(-1px); }
.rate-card-left { display: flex; align-items: center; gap: .6rem; min-width: 0; }
.rate-flag { font-size: 1.2rem; line-height: 1; flex-shrink: 0; }
.rate-pair { font-size: .8rem; font-weight: 700; color: var(--color-text); }
.rate-pair-label { font-size: .72rem; color: var(--color-muted); }
.rate-value { text-align: right; flex-shrink: 0; }
.rate-number { font-size: .95rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.rate-change { font-size: .72rem; font-weight: 600; }
.rate-change.pos { color: var(--color-green); }
.rate-change.neg { color: var(--color-red); }

/* ── Mini Sparkline ───────────────────────────────────────── */
.sparkline { display: inline-block; vertical-align: middle; }

/* ── Pair Page ────────────────────────────────────────────── */
.pair-hero {
  background: linear-gradient(158deg, #0f172a 0%, #1e3a8a 55%, #0e4f5c 100%);
  padding: 2.5rem 0 3rem;
  color: #fff;
  position: relative;
  overflow: hidden;
}
.pair-hero-glow {
  position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse 80% 90% at 75% 110%, rgba(20,184,166,.16) 0%, transparent 60%),
              radial-gradient(ellipse 50% 60% at 10% -10%, rgba(99,102,241,.12) 0%, transparent 55%);
}
.pair-breadcrumb {
  display: flex; align-items: center; gap: .4rem;
  font-size: .75rem; color: rgba(255,255,255,.38); margin-bottom: 2rem;
}
.pair-breadcrumb a { color: rgba(255,255,255,.42); text-decoration: none; transition: color .15s; }
.pair-breadcrumb a:hover { color: rgba(255,255,255,.75); }
.pair-breadcrumb span[aria-hidden] { opacity: .25; }

/* Two-column layout */
.pair-hero-body {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 2rem; flex-wrap: wrap;
}
.pair-hero-left { flex: 1; min-width: 280px; }

/* Flags + code row */
.pair-hero-identity { display: flex; align-items: center; gap: .85rem; margin-bottom: 1.4rem; flex-wrap: wrap; }
.pair-swap-btn {
  display: flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0;
  background: rgba(255,255,255,.12); border: 1.5px solid rgba(255,255,255,.25);
  color: #fff; text-decoration: none; margin-left: .25rem;
  transition: background .15s, border-color .15s, transform .2s;
}
.pair-swap-btn:hover { background: var(--crv-teal, oklch(0.60 0.16 200)); border-color: var(--crv-teal, oklch(0.60 0.16 200)); transform: rotate(180deg); }
.pair-hero-flag-stack { position: relative; width: 56px; height: 36px; flex-shrink: 0; }
.pair-hero-flag-a { position: absolute; left: 0; top: 0; font-size: 1.9rem; line-height: 1; filter: drop-shadow(0 2px 4px rgba(0,0,0,.35)); }
.pair-hero-flag-b { position: absolute; left: 22px; top: 4px; font-size: 1.55rem; line-height: 1; filter: drop-shadow(0 2px 4px rgba(0,0,0,.35)); }
.pair-hero-pair-code {
  font-size: 1rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: #fff;
}
.pair-hero-pair-names { font-size: .78rem; color: rgba(255,255,255,.45); margin-top: 2px; }

.pair-hero-title {
  font-size: clamp(1.5rem, 3vw, 2.2rem); font-weight: 800;
  letter-spacing: -.03em; line-height: 1.15; margin-bottom: 1.25rem;
  color: rgba(255,255,255,.9);
}
.pair-hero-rate-block { display: flex; flex-direction: column; gap: .2rem; }
.pair-hero-rate-eq { font-size: .85rem; color: rgba(255,255,255,.45); font-weight: 500; }
.pair-hero-rate {
  font-size: clamp(2.4rem, 5vw, 3.6rem); font-weight: 800;
  letter-spacing: -.04em; line-height: 1; font-variant-numeric: tabular-nums;
  color: #fff;
}
.pair-hero-rate-to { font-size: 1.4rem; font-weight: 700; color: rgba(255,255,255,.55); margin-left: .3rem; }

/* Stats — right column */
.pair-hero-stats {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: .6rem; align-self: center; flex-shrink: 0;
}
.pair-stat {
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 12px; padding: .85rem 1.1rem;
  backdrop-filter: blur(4px);
}
.pair-stat-label { font-size: .68rem; color: rgba(255,255,255,.45); text-transform: uppercase; letter-spacing: .07em; margin-bottom: .3rem; }
.pair-stat-value { font-size: 1rem; font-weight: 700; }

.pair-content { padding: 3rem 0; }
.pair-grid { display: grid; grid-template-columns: 1fr 340px; gap: 2rem; }
.chart-section { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg); padding: 1.5rem; }
.chart-period-tabs { display: flex; gap: .3rem; margin-bottom: 1.5rem; }
.period-btn { padding: .3rem .7rem; font-size: .8rem; font-weight: 600; border-radius: var(--radius-sm); color: var(--color-muted); transition: background var(--dur), color var(--dur); }
.period-btn:hover { color: var(--color-text); background: var(--color-surface2); }
.period-btn.active { background: var(--brand-primary); color: #fff; }
.chart-wrap { position: relative; height: 300px; }

/* ── Crypto Page ──────────────────────────────────────────── */
.crypto-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}
.crypto-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  transition: box-shadow var(--dur), transform var(--dur);
  cursor: pointer;
}
.crypto-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.crypto-card-header { display: flex; align-items: center; gap: .75rem; margin-bottom: .75rem; }
.crypto-icon {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--color-surface2);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; font-weight: 800; color: var(--brand-primary);
  flex-shrink: 0;
}
.crypto-name { font-weight: 700; font-size: .95rem; }
.crypto-symbol { font-size: .78rem; color: var(--color-muted); }
.crypto-price { font-size: 1.3rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.crypto-change { font-size: .85rem; font-weight: 600; }
.crypto-mcap { font-size: .78rem; color: var(--color-muted); margin-top: .35rem; }

/* ── Strength Meter ───────────────────────────────────────── */
.strength-page { padding: 3rem 0; }
.strength-header { text-align: center; margin-bottom: 3rem; }
.strength-title { font-size: clamp(1.5rem, 3vw, 2.2rem); font-weight: 800; letter-spacing: -.03em; margin-bottom: .5rem; }
.strength-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.25rem; max-width: 1000px; margin: 0 auto;
}
.strength-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  text-align: center;
}
.strength-flag { font-size: 2rem; margin-bottom: .5rem; }
.strength-currency { font-size: 1rem; font-weight: 700; margin-bottom: .75rem; }
.strength-bar-wrap { height: 8px; background: var(--color-surface2); border-radius: var(--radius-full); overflow: hidden; margin-bottom: .5rem; }
.strength-bar { height: 100%; border-radius: var(--radius-full); transition: width .6s var(--ease); }
.strength-score { font-size: .82rem; font-weight: 600; }

/* ── Historical Page ──────────────────────────────────────── */
.historical-page { padding: 3rem 0; }
.historical-controls {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 2rem;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem; align-items: end;
}

/* ── Travel Page ──────────────────────────────────────────── */
.travel-page { padding: 3rem 0; }
.travel-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; }
.travel-card { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg); padding: 1.75rem; }
.travel-card h2 { font-size: 1.1rem; font-weight: 700; margin-bottom: 1.25rem; }
.travel-fee-list { display: flex; flex-direction: column; gap: .5rem; margin-top: 1rem; }
.travel-fee-item { display: flex; justify-content: space-between; align-items: center; padding: .7rem .9rem; background: var(--color-surface2); border-radius: var(--radius-sm); font-size: .88rem; }
.travel-fee-item strong { font-variant-numeric: tabular-nums; }
.travel-total { display: flex; justify-content: space-between; align-items: center; padding: .9rem; background: var(--brand-light); border-radius: var(--radius); border: 1px solid rgba(26,86,219,.2); font-weight: 700; margin-top: .75rem; }
.travel-total .amount { font-size: 1.15rem; color: var(--brand-primary); }

/* ── Alerts Page ──────────────────────────────────────────── */
.alerts-page { padding: 3rem 0; }
.alerts-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; align-items: start; }
.alert-form-card { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg); padding: 1.75rem; position: sticky; top: calc(var(--header-h) + 1rem); }
.alert-form-card h2 { font-size: 1.15rem; font-weight: 700; margin-bottom: 1.5rem; }
.alert-form-fields { display: flex; flex-direction: column; gap: 1rem; }
.alert-pair-row { display: grid; grid-template-columns: 1fr auto 1fr; gap: .5rem; align-items: end; }
.direction-toggle { display: flex; border: 1px solid var(--color-border2); border-radius: var(--radius); overflow: hidden; margin-top: .4rem; }
.direction-btn { flex: 1; padding: .6rem; font-size: .82rem; font-weight: 600; color: var(--color-muted); background: var(--color-surface); transition: background var(--dur), color var(--dur); }
.direction-btn.active { background: var(--brand-primary); color: #fff; }

/* ── Page: 404 ────────────────────────────────────────────── */
.error-page { display: flex; align-items: center; justify-content: center; min-height: 60vh; text-align: center; padding: 3rem; }
.error-code { font-size: 5rem; font-weight: 900; color: var(--brand-primary); line-height: 1; }
.error-title { font-size: 1.5rem; font-weight: 700; margin: .5rem 0; }
.error-desc { color: var(--color-muted); margin-bottom: 1.5rem; }

/* ── Features Strip ───────────────────────────────────────── */
.features-strip { padding: 3rem 0; }
.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1.25rem; }
.feature-card { display: flex; gap: 1rem; align-items: flex-start; padding: 1.25rem; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg); }
.feature-icon { width: 42px; height: 42px; border-radius: var(--radius); background: var(--brand-light); color: var(--brand-primary); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.feature-title { font-size: .92rem; font-weight: 700; margin-bottom: .25rem; }
.feature-desc { font-size: .82rem; color: var(--color-muted); line-height: 1.5; }

/* ── Popular Pairs ────────────────────────────────────────── */
.popular-pairs { padding: 2rem 0 3rem; }
.pairs-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .6rem; }
.pair-link {
  display: flex; align-items: center; justify-content: space-between;
  padding: .75rem 1rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-size: .88rem; font-weight: 600;
  transition: background var(--dur), border-color var(--dur), box-shadow var(--dur);
}
.pair-link:hover { background: var(--brand-light); border-color: rgba(26,86,219,.25); box-shadow: var(--shadow-sm); }
.pair-link-flags { font-size: 1rem; }
.pair-link-rate { font-size: .8rem; font-weight: 700; color: var(--color-muted); font-variant-numeric: tabular-nums; }

/* ── Toast ────────────────────────────────────────────────── */
.toast-container { position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 1000; display: flex; flex-direction: column; gap: .5rem; pointer-events: none; }
.toast {
  display: flex; align-items: center; gap: .75rem;
  padding: .8rem 1.2rem;
  background: var(--color-text); color: var(--color-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  font-size: .875rem; font-weight: 500;
  max-width: 360px; pointer-events: all;
  animation: toast-in .25s var(--ease);
}
.toast.success { background: var(--color-green); color: #fff; }
.toast.error   { background: var(--color-red);   color: #fff; }
.toast.out     { animation: toast-out .2s var(--ease) forwards; }
@keyframes toast-in  { from{opacity:0;transform:translateY(12px)} to{opacity:1;transform:none} }
@keyframes toast-out { to{opacity:0;transform:translateY(12px)} }

/* ── Loader ───────────────────────────────────────────────── */
.spinner {
  width: 22px; height: 22px;
  border: 2.5px solid var(--color-border2);
  border-top-color: var(--brand-primary);
  border-radius: 50%;
  animation: spin .65s linear infinite;
  display: inline-block;
}
@keyframes spin { to{transform:rotate(360deg)} }
.loading-overlay { display: flex; align-items: center; justify-content: center; min-height: 200px; }

/* ── Table ────────────────────────────────────────────────── */
.data-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.data-table th {
  padding: .75rem 1rem;
  text-align: left;
  font-size: .75rem; font-weight: 700; color: var(--color-muted);
  letter-spacing: .05em; text-transform: uppercase;
  border-bottom: 2px solid var(--color-border);
  white-space: nowrap;
}
.data-table td {
  padding: .75rem 1rem;
  border-bottom: 1px solid var(--color-border);
  vertical-align: middle;
}
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover td { background: var(--color-surface2); }
.data-table-wrap { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg); overflow: hidden; }
.table-scroll { overflow-x: auto; }

/* ── Pagination ───────────────────────────────────────────── */
.pagination { display: flex; align-items: center; gap: .4rem; justify-content: center; padding: 1.5rem 0; }
.page-btn {
  min-width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius); font-size: .85rem; font-weight: 600;
  color: var(--color-muted); border: 1px solid var(--color-border);
  transition: background var(--dur), color var(--dur), border-color var(--dur);
  background: var(--color-surface);
}
.page-btn:hover { color: var(--color-text); border-color: var(--color-border2); }
.page-btn.active { background: var(--brand-primary); color: #fff; border-color: var(--brand-primary); }
.page-btn:disabled { opacity: .4; pointer-events: none; }

/* ── Footer ───────────────────────────────────────────────── */
.site-footer {
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  padding: 3.5rem 0 1.5rem;
  margin-top: 4rem;
}
.footer-grid {
  display: grid; grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 2.5rem; margin-bottom: 2.5rem;
}
.footer-logo { font-size: 1.15rem; font-weight: 800; margin-bottom: .7rem; display: block; color: var(--color-text); }
.footer-logo span { color: var(--brand-primary); }
.footer-tagline { font-size: .88rem; color: var(--color-muted); line-height: 1.6; margin-bottom: .75rem; }
.footer-note { font-size: .78rem; color: var(--color-subtle); line-height: 1.5; }
.footer-heading { font-size: .78rem; font-weight: 700; color: var(--color-muted); letter-spacing: .08em; text-transform: uppercase; margin-bottom: .9rem; }
.footer-links ul { display: flex; flex-direction: column; gap: .5rem; }
.footer-links a { font-size: .88rem; color: var(--color-muted); transition: color var(--dur); }
.footer-links a:hover { color: var(--color-text); }
.footer-bottom { border-top: 1px solid var(--color-border); padding-top: 1.25rem; font-size: .8rem; color: var(--color-subtle); text-align: center; }

/* ── Breadcrumb ───────────────────────────────────────────── */
.breadcrumb { display: flex; align-items: center; gap: .5rem; font-size: .82rem; color: var(--color-muted); margin-bottom: 1rem; flex-wrap: wrap; }
.breadcrumb a { color: var(--color-muted); transition: color var(--dur); }
.breadcrumb a:hover { color: var(--color-text); }
.breadcrumb-sep { color: var(--color-subtle); }

/* ── Ticker Bar ───────────────────────────────────────────── */
.ticker-bar {
  background: var(--color-surface2);
  border-bottom: 1px solid var(--color-border);
  overflow: hidden; height: 36px;
  position: relative;
}
.ticker-track {
  display: flex; align-items: center; gap: 2rem;
  height: 100%; white-space: nowrap;
  animation: ticker-scroll 40s linear infinite;
}
.ticker-track:hover { animation-play-state: paused; }
.ticker-item { display: flex; align-items: center; gap: .5rem; font-size: .8rem; font-weight: 500; padding: 0 .5rem; }
.ticker-pair { color: var(--color-muted); }
.ticker-rate { font-variant-numeric: tabular-nums; font-weight: 700; }
.ticker-chg { font-size: .72rem; font-weight: 600; }
@keyframes ticker-scroll { 0%{transform:translateX(0)} 100%{transform:translateX(-50%)} }

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

/* ── Tier badge next to username in header ─────────────────── */
.header-tier-badge {
  display: inline-block;
  margin-left: .375rem;
  padding: .1rem .4rem;
  border-radius: 20px;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .02em;
  vertical-align: middle;
  line-height: 1.4;
}

@media (max-width: 768px) {
  /* ── Header: logo | (flex gap) | theme-toggle | hamburger ── */
  .header-inner { gap: .5rem; padding: 0 1rem; overflow: visible; }
  .site-logo { flex-shrink: 0; }

  /* Hide Login + Sign Up buttons from header bar */
  .nav-link--desktop-only { display: none !important; }

  /* Show hamburger button */
  .hamburger { display: flex; flex-shrink: 0; }

  /* Mobile nav overlay */
  .primary-nav {
    display: none;
    position: fixed;
    top: var(--header-h); left: 0; right: 0;
    background: var(--color-surface);
    border-bottom: 2px solid var(--color-border);
    padding: .5rem .75rem .85rem;
    box-shadow: 0 8px 24px rgba(0,0,0,.15);
    z-index: 9999;
  }
  .primary-nav.open { display: block; }
  .nav-list { flex-direction: column; gap: .1rem; }
  .nav-link { padding: .75rem 1rem; border-radius: var(--radius); display: block; }

  /* Auth section inside hamburger menu */
  .nav-mobile-auth {
    display: block;
    margin-top: .5rem;
    padding-top: .6rem;
    border-top: 1px solid var(--color-border);
  }

  /* ── Converter ── */
  .converter-card { padding: 1.25rem; }
  .converter-result .result-meta { flex-direction: column; gap: .5rem; }
  .rate-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
  .footer-grid { grid-template-columns: 1fr; gap: 1.75rem; }
  .hero { padding: 2.5rem 0 2rem; }
  .historical-controls { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .converter-card { padding: 1.25rem; border-radius: var(--radius-lg); }
  .result-amount { font-size: 1.5rem; }
  .converter-actions { flex-direction: column; }
}

/* ── Print ────────────────────────────────────────────────── */
@media print {
  .site-header, .site-footer, .crv-footer, .ticker-bar, .converter-actions, .btn { display: none !important; }
  body { background: #fff; color: #000; }
}

/* ── Animations (reduced motion) ─────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

/* ════════════════════════════════════════════════════════════
   BANKS DIRECTORY
   ════════════════════════════════════════════════════════════ */

/* Hero */
.page-hero--banks {
  background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 100%);
  color: #fff;
  padding: 3rem 0 2.5rem;
  text-align: center;
}
.page-hero__title { font-size: 2rem; font-weight: 700; margin: 0 0 .5rem; }
.page-hero__sub   { color: rgba(255,255,255,.7); margin: 0; font-size: 1rem; }

/* Layout: sidebar + results */
.banks-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 1.5rem;
  padding-top: 1.5rem;
  padding-bottom: 3rem;
  align-items: start;
}

/* Filters sidebar */
.banks-filters {
  background: var(--surface, #fff);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: var(--radius-lg, 12px);
  padding: 1.25rem;
  position: sticky;
  top: 80px;
}
.banks-filters__head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.banks-filters__title { font-size: .95rem; font-weight: 600; margin: 0; }
.banks-filters__close { display: none; background: none; border: none; cursor: pointer; font-size: 1rem; color: #64748b; }
.filter-group { margin-bottom: 1rem; }
.filter-label { display: block; font-size: .8rem; font-weight: 500; color: #64748b; margin-bottom: .3rem; text-transform: uppercase; letter-spacing: .04em; }
.filter-input,
.filter-select { width: 100%; padding: .5rem .75rem; border: 1px solid var(--border, #e2e8f0); border-radius: 8px; font-size: .875rem; background: var(--surface, #fff); color: var(--text, #0f172a); box-sizing: border-box; }
.filter-input:focus, .filter-select:focus { outline: 2px solid var(--primary, #2563eb); outline-offset: -1px; }
.btn-full { width: 100%; justify-content: center; }
.btn-ghost { background: transparent; border: 1px solid var(--border, #e2e8f0); color: var(--text, #0f172a); }
.btn-ghost:hover { background: var(--surface-raised, #f8fafc); }

/* Toolbar */
.banks-toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.banks-toolbar__count { font-size: .875rem; color: #64748b; }
#filters-open { display: none; }

/* Banks grid */
.banks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.bank-card {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  padding: 1rem;
  background: var(--surface, #fff);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: var(--radius-lg, 12px);
  text-decoration: none;
  color: inherit;
  transition: box-shadow .15s, border-color .15s, transform .15s;
  position: relative;
  overflow: hidden;
}
.bank-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.1); border-color: var(--primary, #2563eb); transform: translateY(-1px); }
.bank-card__flag { flex-shrink: 0; margin-top: 2px; }
.bank-card__body { flex: 1; min-width: 0; }
.bank-card__name { font-size: .9rem; font-weight: 600; margin: 0 0 .25rem; line-height: 1.3; }
.bank-card__meta { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: .25rem; }
.bank-card__country { font-size: .75rem; color: #64748b; }
.bank-card__type { font-size: .72rem; background: #eff6ff; color: #2563eb; padding: .1rem .4rem; border-radius: 4px; font-weight: 500; }
.bank-card__hq { font-size: .75rem; color: #94a3b8; display: flex; align-items: center; gap: .3rem; }
.bank-card__assets { font-size: .75rem; color: #16a34a; font-weight: 500; margin-top: .2rem; }
.bank-card__featured-badge { position: absolute; top: .5rem; right: .5rem; font-size: .8rem; color: #f59e0b; }

/* Empty state */
.banks-empty { text-align: center; padding: 3rem 1rem; color: #64748b; }
.banks-empty svg { opacity: .3; margin-bottom: 1rem; }
.banks-empty p { margin: 0 0 1rem; }

/* Pagination */
.pagination { display: flex; justify-content: center; gap: .4rem; margin-top: 2rem; flex-wrap: wrap; }
.pagination__btn { display: inline-flex; align-items: center; justify-content: center; min-width: 36px; height: 36px; padding: 0 .5rem; border: 1px solid var(--border, #e2e8f0); border-radius: 8px; text-decoration: none; font-size: .85rem; color: var(--text, #0f172a); background: var(--surface, #fff); transition: all .15s; }
.pagination__btn:hover, .pagination__btn.active { background: var(--primary, #2563eb); color: #fff; border-color: var(--primary, #2563eb); }
.pagination__dots { display: inline-flex; align-items: center; color: #94a3b8; padding: 0 .25rem; }

/* ── Bank detail page ── */
.bank-detail { padding: 1.5rem 0 3rem; }
.breadcrumb { font-size: .8rem; color: #64748b; display: flex; flex-wrap: wrap; gap: .3rem; align-items: center; margin-bottom: 1.5rem; }
.breadcrumb a { color: var(--primary, #2563eb); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb span { color: #cbd5e1; }

.bank-detail__layout { display: grid; grid-template-columns: 1fr 280px; gap: 2rem; align-items: start; }

.bank-detail__main { background: var(--surface, #fff); border: 1px solid var(--border, #e2e8f0); border-radius: var(--radius-lg, 12px); padding: 1.75rem; }
.bank-detail__header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 1.25rem; gap: 1rem; flex-wrap: wrap; }
.bank-detail__flag-name { display: flex; align-items: center; gap: .75rem; }
.bank-detail__name { font-size: 1.5rem; font-weight: 700; margin: 0; }
.bank-detail__name-local { font-size: .9rem; color: #64748b; margin: .2rem 0 0; }

.bank-type-badge { display: inline-block; padding: .3rem .8rem; border-radius: 20px; font-size: .8rem; font-weight: 500; background: #eff6ff; color: #2563eb; white-space: nowrap; }
.bank-type-badge--central    { background: #fef3c7; color: #92400e; }
.bank-type-badge--investment { background: #f0fdf4; color: #166534; }
.bank-type-badge--islamic    { background: #f0fdfa; color: #134e4a; }
.bank-type-badge--private    { background: #faf5ff; color: #6b21a8; }

.bank-detail__desc { color: #475569; line-height: 1.7; margin-bottom: 1.5rem; }

.bank-facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .75rem; margin-bottom: 1.5rem; }
.bank-fact { background: var(--surface-raised, #f8fafc); border-radius: 8px; padding: .75rem 1rem; }
.bank-fact__label { display: block; font-size: .73rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: #94a3b8; margin-bottom: .25rem; }
.bank-fact__value { font-size: .9rem; font-weight: 500; color: var(--text, #0f172a); }
.bank-fact__value a { color: var(--primary, #2563eb); text-decoration: none; }
.bank-fact__value a:hover { text-decoration: underline; }
.bank-fact__value code { font-family: 'JetBrains Mono', monospace; background: #f1f5f9; padding: .1rem .3rem; border-radius: 3px; font-size: .85rem; }

.bank-converter-cta { background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%); border-radius: 10px; padding: 1rem 1.25rem; display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; }
.bank-converter-cta p { margin: 0; flex: 1; min-width: 180px; font-size: .875rem; color: #1e40af; }

/* Sidebar */
.bank-detail__sidebar { display: flex; flex-direction: column; gap: 1rem; }
.bank-related { background: var(--surface, #fff); border: 1px solid var(--border, #e2e8f0); border-radius: var(--radius-lg, 12px); padding: 1.25rem; }
.bank-related__title { font-size: .9rem; font-weight: 600; margin: 0 0 .75rem; }
.bank-related__list { list-style: none; margin: 0 0 .75rem; padding: 0; display: flex; flex-direction: column; gap: .25rem; }
.bank-related__list li a { font-size: .85rem; color: var(--text, #0f172a); text-decoration: none; display: flex; justify-content: space-between; align-items: center; padding: .3rem 0; border-bottom: 1px solid var(--border, #e2e8f0); }
.bank-related__list li a small { color: #94a3b8; font-size: .75rem; }
.bank-related__list li a:hover { color: var(--primary, #2563eb); }
.bank-related__all { font-size: .8rem; color: var(--primary, #2563eb); text-decoration: none; }
.bank-related__all:hover { text-decoration: underline; }
.bank-sidebar-cta { background: var(--surface, #fff); border: 1px solid var(--border, #e2e8f0); border-radius: var(--radius-lg, 12px); padding: 1.25rem; text-align: center; }
.bank-sidebar-cta h3 { font-size: .9rem; margin: 0 0 .4rem; }
.bank-sidebar-cta p { font-size: .8rem; color: #64748b; margin: 0 0 .75rem; }

.bank-back { margin-top: 2rem; }
.bank-back a { font-size: .875rem; color: var(--primary, #2563eb); text-decoration: none; }
.bank-back a:hover { text-decoration: underline; }

/* ── Responsive banks ── */
@media (max-width: 1024px) {
  .banks-layout { grid-template-columns: 1fr; }
  .banks-filters { position: fixed; top: 0; left: -320px; width: 300px; height: 100vh; z-index: 200; overflow-y: auto; border-radius: 0; transition: left .25s ease; }
  .banks-filters.open { left: 0; box-shadow: 4px 0 20px rgba(0,0,0,.15); }
  .banks-filters__close { display: block; }
  #filters-open { display: inline-flex; }
  .bank-detail__layout { grid-template-columns: 1fr; }
  .bank-detail__sidebar { order: -1; }
}
@media (max-width: 640px) {
  .banks-grid { grid-template-columns: 1fr; }
  .bank-facts { grid-template-columns: 1fr 1fr; }
  .bank-detail__header { flex-direction: column; }
  .page-hero__title { font-size: 1.5rem; }
}

/* ── Shared Final CTA section ────────────────────────────── */
.crv-final-cta {
  background: linear-gradient(158deg, var(--crv-navy, oklch(0.22 0.06 258)) 0%, oklch(0.27 0.09 256) 52%, oklch(0.22 0.08 205) 100%);
  padding: 96px 2rem;
  text-align: center;
  position: relative; overflow: hidden;
}
.crv-final-cta::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse 60% 70% at 50% 110%, oklch(0.60 0.16 200 / .20) 0%, transparent 60%);
  pointer-events: none;
}
.crv-final-cta-inner { max-width: 640px; margin: 0 auto; position: relative; }
.crv-final-cta h2 {
  font-family: var(--font-display, 'Sora', sans-serif);
  font-size: clamp(28px, 4vw, 48px);
  font-weight: 800; color: white;
  letter-spacing: -.04em; line-height: 1.1;
  margin-bottom: 18px;
}
.crv-final-cta h2 em { color: oklch(0.76 0.15 174); font-style: normal; }
.crv-final-cta p { font-size: 18px; color: oklch(0.76 0.03 255); line-height: 1.65; margin-bottom: 38px; }
.crv-final-cta-btns { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.crv-cta-btn-white {
  padding: 14px 28px;
  background: white; color: var(--crv-navy, oklch(0.22 0.06 258));
  border-radius: 13px; font-weight: 700; font-size: 15px;
  text-decoration: none; transition: opacity .15s;
  font-family: var(--font-display, 'Sora', sans-serif);
  display: inline-flex; align-items: center; gap: 8px;
}
.crv-cta-btn-white:hover { opacity: .92; }
.crv-btn-outline-light {
  background: oklch(1 0 0 / .06);
  border: 1.5px solid oklch(1 0 0 / .22);
  color: white;
  font-family: var(--font-display, 'Sora', sans-serif);
  font-weight: 600;
  border-radius: 13px;
  text-decoration: none;
  transition: border-color .15s, background .15s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.crv-btn-outline-light:hover { border-color: oklch(1 0 0 / .4); background: oklch(1 0 0 / .10); }

/* ════════════════════════════════════════════════════════════
   DARK MODE — Component & Page Overrides
   Fixes hardcoded light-only colours in account pages,
   admin pages, bank pages, and general components.
   ════════════════════════════════════════════════════════════ */

/* ── Account dashboard sidebar ─────────────────────────────── */
[data-theme="dark"] .acc-sidebar {
  background: var(--color-surface);
  border-right-color: var(--color-border);
}
[data-theme="dark"] .acc-sidebar-nav a,
[data-theme="dark"] .acc-sidebar-section {
  color: var(--color-muted);
}
[data-theme="dark"] .acc-sidebar-nav a:hover,
[data-theme="dark"] .acc-sidebar-nav a.active {
  background: var(--color-surface2);
  color: var(--color-text);
}
[data-theme="dark"] .acc-sidebar-brand {
  background: var(--color-surface2);
  border-bottom-color: var(--color-border);
}

/* ── Generic surface / input overrides (account pages) ─────── */
[data-theme="dark"] .summary-bar,
[data-theme="dark"] .exp-card,
[data-theme="dark"] .chart-card,
[data-theme="dark"] .pf-card,
[data-theme="dark"] .goal-card,
[data-theme="dark"] .alert-row,
[data-theme="dark"] .new-goal-card,
[data-theme="dark"] .billing-card,
[data-theme="dark"] .settings-card,
[data-theme="dark"] .api-card,
[data-theme="dark"] .fav-card {
  background: var(--color-surface);
  border-color: var(--color-border);
}

[data-theme="dark"] .add-form-wrap,
[data-theme="dark"] .goal-contrib-form,
[data-theme="dark"] .exp-edit-row td,
[data-theme="dark"] .hist-edit-row,
[data-theme="dark"] .goal-edit-form {
  background: var(--color-surface2);
  border-color: var(--color-border);
}

[data-theme="dark"] .exp-table tr:hover td,
[data-theme="dark"] .exp-table th {
  background: var(--color-surface2);
}
[data-theme="dark"] .exp-table td,
[data-theme="dark"] .exp-table th {
  border-color: var(--color-border);
}

[data-theme="dark"] .cat-tag {
  background: var(--color-surface2);
  border-color: var(--color-border);
  color: var(--color-text);
}

[data-theme="dark"] .month-nav a,
[data-theme="dark"] .goal-history-toggle,
[data-theme="dark"] .goal-del-btn,
[data-theme="dark"] .exp-del-btn,
[data-theme="dark"] .exp-edit-btn,
[data-theme="dark"] .hist-cancel-btn,
[data-theme="dark"] .goal-edit-cancel,
[data-theme="dark"] .exp-edit-cancel {
  background: var(--color-surface2);
  border-color: var(--color-border);
  color: var(--color-muted);
}

[data-theme="dark"] .form-input,
[data-theme="dark"] .form-select,
[data-theme="dark"] .cur-trigger,
[data-theme="dark"] .filter-input,
[data-theme="dark"] .filter-select {
  background: var(--color-surface2);
  border-color: var(--color-border);
  color: var(--color-text);
}
[data-theme="dark"] .form-input::placeholder,
[data-theme="dark"] .filter-input::placeholder { color: var(--color-subtle); }

/* Currency dropdown */
[data-theme="dark"] .cur-dropdown {
  background: var(--color-surface);
  border-color: var(--color-border);
}
[data-theme="dark"] .cur-search {
  background: var(--color-surface2);
  border-color: var(--color-border);
  color: var(--color-text);
}
[data-theme="dark"] .cur-opt:hover,
[data-theme="dark"] .cur-opt.active {
  background: var(--color-surface2);
}
[data-theme="dark"] .cur-opt-name { color: var(--color-muted); }

/* ── Category inline badge on expense table ─────────────────── */
[data-theme="dark"] .exp-table td span[style*="background:var(--bg"] {
  background: var(--color-surface2) !important;
  border-color: var(--color-border) !important;
}

/* ── Goal progress & history ────────────────────────────────── */
[data-theme="dark"] .progress-bar-bg { background: var(--color-surface2); }
[data-theme="dark"] .goal-history-panel,
[data-theme="dark"] .goal-history-inner { background: var(--color-surface2); }
[data-theme="dark"] .hist-row { border-color: var(--color-border); }

/* ── Portfolio ──────────────────────────────────────────────── */
[data-theme="dark"] .pf-entry-row:hover { background: var(--color-surface2); }
[data-theme="dark"] .pf-entry-row { border-color: var(--color-border); }

/* ── Alert rows ─────────────────────────────────────────────── */
[data-theme="dark"] .alert-detail,
[data-theme="dark"] .alert-badge-unconfirmed { color: var(--color-muted); }
[data-theme="dark"] .alert-badge-unconfirmed { background: rgba(245,158,11,.15); color: #fbbf24; }

/* ── Banks directory hardcoded colours ──────────────────────── */
[data-theme="dark"] .banks-filters {
  background: var(--color-surface);
  border-color: var(--color-border);
}
[data-theme="dark"] .filter-label,
[data-theme="dark"] .banks-toolbar__count,
[data-theme="dark"] .banks-empty,
[data-theme="dark"] .bank-card__country,
[data-theme="dark"] .bank-card__hq,
[data-theme="dark"] .bank-detail__name-local,
[data-theme="dark"] .bank-detail__desc,
[data-theme="dark"] .bank-sidebar-cta p { color: var(--color-muted); }

[data-theme="dark"] .bank-card {
  background: var(--color-surface);
  border-color: var(--color-border);
}
[data-theme="dark"] .bank-detail__main,
[data-theme="dark"] .bank-related,
[data-theme="dark"] .bank-sidebar-cta {
  background: var(--color-surface);
  border-color: var(--color-border);
}
[data-theme="dark"] .bank-fact {
  background: var(--color-surface2);
}
[data-theme="dark"] .bank-fact__value code {
  background: var(--color-border);
  color: var(--color-text);
}
[data-theme="dark"] .bank-related__list li a {
  border-color: var(--color-border);
  color: var(--color-muted);
}
[data-theme="dark"] .bank-converter-cta {
  background: linear-gradient(135deg, rgba(26,86,219,.15) 0%, rgba(26,86,219,.08) 100%);
}
[data-theme="dark"] .bank-converter-cta p { color: #93c5fd; }
[data-theme="dark"] .bank-type-badge { background: rgba(26,86,219,.2); color: #93c5fd; }
[data-theme="dark"] .bank-type-badge--central { background: rgba(245,158,11,.15); color: #fbbf24; }
[data-theme="dark"] .bank-type-badge--investment { background: rgba(16,185,129,.12); color: #34d399; }
[data-theme="dark"] .bank-type-badge--islamic { background: rgba(20,184,166,.12); color: #2dd4bf; }
[data-theme="dark"] .bank-type-badge--private { background: rgba(168,85,247,.12); color: #c084fc; }

/* ── AI chat widget ──────────────────────────────────────────── */
[data-theme="dark"] .ai-widget-panel {
  background: var(--color-surface);
  border-color: var(--color-border);
}
[data-theme="dark"] .ai-message-user .ai-bubble {
  background: var(--brand-primary);
}
[data-theme="dark"] .ai-message-ai .ai-bubble {
  background: var(--color-surface2);
  color: var(--color-text);
}
[data-theme="dark"] .ai-input-wrap {
  background: var(--color-surface);
  border-top-color: var(--color-border);
}
[data-theme="dark"] .ai-input {
  background: var(--color-surface2);
  border-color: var(--color-border);
  color: var(--color-text);
}
[data-theme="dark"] .ai-widget-header {
  background: var(--brand-primary);
}
[data-theme="dark"] .ai-disclaimer {
  color: var(--color-subtle);
}

/* ── Navigation dark mode ────────────────────────────────────── */
[data-theme="dark"] .nav-dd-menu {
  background: var(--color-surface);
  border-color: var(--color-border);
}
[data-theme="dark"] .user-dd-menu {
  background: var(--color-surface);
  border-color: var(--color-border);
  box-shadow: var(--shadow-lg);
}
[data-theme="dark"] .nav-dd-link:hover { background: var(--color-surface2); }
[data-theme="dark"] .primary-nav { background: var(--color-surface); border-color: var(--color-border); }

/* ── Admin pages ─────────────────────────────────────────────── */
[data-theme="dark"] .admin-card,
[data-theme="dark"] .admin-sidebar,
[data-theme="dark"] .settings-section {
  background: var(--color-surface);
  border-color: var(--color-border);
}
[data-theme="dark"] .admin-sidebar a { color: var(--color-muted); }
[data-theme="dark"] .admin-sidebar a:hover,
[data-theme="dark"] .admin-sidebar a.active { background: var(--color-surface2); color: var(--color-text); }

/* ── Modals / overlays ────────────────────────────────────────── */
[data-theme="dark"] .modal-backdrop { background: rgba(0,0,0,.6); }
[data-theme="dark"] .modal-box {
  background: var(--color-surface);
  border-color: var(--color-border);
}

/* ── Locale modal / country section ─────────────────────────── */
[data-theme="dark"] .locale-modal,
[data-theme="dark"] .country-modal {
  background: var(--color-surface);
  border-color: var(--color-border);
}

/* ── Pricing page ────────────────────────────────────────────── */
[data-theme="dark"] .pricing-card {
  background: var(--color-surface);
  border-color: var(--color-border);
}
[data-theme="dark"] .pricing-card.featured {
  border-color: var(--brand-primary);
}

/* ── Help / article pages ────────────────────────────────────── */
[data-theme="dark"] .help-article,
[data-theme="dark"] .help-sidebar {
  background: var(--color-surface);
  border-color: var(--color-border);
}
[data-theme="dark"] .help-article h2,
[data-theme="dark"] .help-article h3 { color: var(--color-text); }
[data-theme="dark"] .help-article p,
[data-theme="dark"] .help-article li { color: var(--color-muted); }

/* ── Ticker ──────────────────────────────────────────────────── */
[data-theme="dark"] .ticker-bar { background: var(--color-surface2); border-color: var(--color-border); }

/* ── Pair AI commentary ──────────────────────────────────────── */
[data-theme="dark"] .pair-ai-commentary {
  background: var(--color-surface2);
  border-color: var(--color-border);
  color: var(--color-muted);
}

/* ── Searchable select widget (ss-*) injected by searchable-select.js ── */
[data-theme="dark"] .ss-trigger {
  background: var(--color-surface2);
  border-color: var(--color-border);
  color: var(--color-text);
}
[data-theme="dark"] .ss-trigger:hover { border-color: var(--color-border2); }
[data-theme="dark"] .ss-dropdown {
  background: var(--color-surface);
  border-color: var(--color-border);
}
[data-theme="dark"] .ss-search-wrap { border-color: var(--color-border); }
[data-theme="dark"] .ss-search {
  background: var(--color-surface2);
  border-color: var(--color-border);
  color: var(--color-text);
}
[data-theme="dark"] .ss-option { color: var(--color-text); }
[data-theme="dark"] .ss-option:hover { background: var(--color-surface2); }
[data-theme="dark"] .ss-option.selected {
  background: var(--brand-light);
  color: #93c5fd;
}

/* ── Converter widget inputs ─────────────────────────────────── */
[data-theme="dark"] .converter-amount {
  background: var(--color-surface2);
  border-color: var(--color-border);
  color: var(--color-text);
}
[data-theme="dark"] .currency-selector {
  background: var(--color-surface2);
  border-color: var(--color-border);
  color: var(--color-text);
}
[data-theme="dark"] .currency-selector:hover {
  background: var(--color-surface);
  border-color: var(--color-border2);
}

/* ── AI chat widget messages ─────────────────────────────────── */
[data-theme="dark"] .ai-msg--assistant {
  background: var(--color-surface2);
  color: var(--color-text);
}
[data-theme="dark"] .ai-chat-panel {
  background: var(--color-surface);
  border-color: var(--color-border);
}
[data-theme="dark"] .ai-chat-header {
  background: var(--color-surface);
  border-color: var(--color-border);
}
[data-theme="dark"] .ai-chat-footer {
  background: var(--color-surface);
  border-color: var(--color-border);
}
[data-theme="dark"] .ai-chat-input {
  background: var(--color-surface2);
  border-color: var(--color-border);
  color: var(--color-text);
}
[data-theme="dark"] .ai-chat-messages { background: var(--color-bg); }

/* ── FAQ section (pricing page) ──────────────────────────────── */
[data-theme="dark"] .prx-faq-title { color: var(--color-text); }
[data-theme="dark"] .prx-faq-item { border-color: var(--color-border); }
[data-theme="dark"] .prx-faq-q { color: var(--color-text); }
[data-theme="dark"] .prx-faq-a { color: var(--color-muted); }

/* ── Homepage converter widget (crv-conv-*) ──────────────────── */
[data-theme="dark"] .crv-conv-card {
  background: var(--color-surface) !important;
  border-color: var(--color-border) !important;
}
[data-theme="dark"] .crv-conv-row {
  background: var(--color-surface2) !important;
  border-color: var(--color-border) !important;
}
[data-theme="dark"] .crv-conv-amount-wrap { border-color: var(--color-border) !important; }
[data-theme="dark"] .crv-conv-input { color: var(--color-text); }
[data-theme="dark"] .conv-selector { color: var(--color-text); }
[data-theme="dark"] .conv-selector:hover { background: var(--color-surface) !important; }
[data-theme="dark"] .conv-sel-code { color: var(--color-text); }
[data-theme="dark"] .conv-sel-name,
[data-theme="dark"] .conv-sel-sep  { color: var(--color-muted); }
[data-theme="dark"] .crv-conv-swap {
  background: var(--color-surface2);
  border-color: var(--color-border);
  color: var(--color-text);
}
[data-theme="dark"] .crv-conv-swap:hover { background: var(--color-border); }
[data-theme="dark"] .crv-conv-result { background: var(--color-surface2) !important; }
[data-theme="dark"] .crv-conv-rate-eq { color: var(--color-text); }

/* ── Focus outline — visible in both themes ──────────────────── */
[data-theme="dark"] :focus-visible {
  outline-color: var(--brand-primary);
}
