/* ================================================================
   AyaSend Premium Design System — v3.0 2026
   Loaded last → wins cascade. No !important abuse.
   Targets: provider cards, CTAs, badges, modals, nav, alerts,
            corridor cards, inputs, trust strip, interstitial.
   ================================================================ */

/* ─── Design Tokens ─────────────────────────────────────────── */
:root {
  --aya-font: 'DM Sans', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --aya-blue: #2563eb;
  --aya-blue-mid: #3b82f6;
  --aya-blue-dark: #1d4ed8;
  --aya-blue-light: #dbeafe;
  --aya-green: #10b981;
  --aya-slate: #0f172a;

  --aya-r-card: 22px;
  --aya-r-btn: 14px;
  --aya-r-badge: 24px;
  --aya-r-input: 16px;
  --aya-r-modal: 28px;

  --aya-shadow-card:    0 2px 12px rgba(15,23,42,.05), 0 1px 3px rgba(15,23,42,.03);
  --aya-shadow-card-md: 0 4px 20px rgba(15,23,42,.07), 0 1px 6px rgba(15,23,42,.04);
  --aya-shadow-card-best: 0 8px 40px rgba(37,99,235,.13), 0 2px 10px rgba(37,99,235,.07);
  --aya-shadow-card-hover: 0 14px 48px rgba(15,23,42,.10), 0 2px 10px rgba(15,23,42,.05);
  --aya-shadow-btn: 0 4px 16px rgba(37,99,235,.36), 0 1px 4px rgba(37,99,235,.18), inset 0 1px 0 rgba(255,255,255,.15);
  --aya-shadow-btn-hover: 0 6px 24px rgba(37,99,235,.48), 0 2px 6px rgba(37,99,235,.22);

  --aya-border-card: rgba(214,222,234,.80);
  --aya-border-card-best: rgba(59,130,246,.26);
  --aya-border-input: rgba(214,222,234,.90);
  --aya-bg-card: #ffffff;
  --aya-bg-subtle: #f8fafc;
  --aya-bg-input: #fafbff;
}

html.dark {
  --aya-border-card: rgba(51,65,85,.65);
  --aya-border-card-best: rgba(59,130,246,.30);
  --aya-border-input: rgba(51,65,85,.80);
  --aya-bg-card: #1e293b;
  --aya-bg-subtle: #0f172a;
  --aya-bg-input: rgba(30,41,59,.70);
  --aya-shadow-card:    0 2px 12px rgba(0,0,0,.20), 0 1px 3px rgba(0,0,0,.12);
  --aya-shadow-card-md: 0 4px 24px rgba(0,0,0,.28), 0 1px 6px rgba(0,0,0,.14);
  --aya-shadow-card-best: 0 8px 40px rgba(37,99,235,.18), 0 2px 10px rgba(37,99,235,.10);
  --aya-shadow-card-hover: 0 14px 52px rgba(0,0,0,.32), 0 2px 10px rgba(0,0,0,.16);
}

/* ─── Global Base ────────────────────────────────────────────── */
body {
  font-family: var(--aya-font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* ─── Provider Cards ─────────────────────────────────────────── */
.rate-card-premium {
  background: var(--aya-bg-card);
  border: 1px solid var(--aya-border-card);
  border-radius: var(--aya-r-card);
  box-shadow: var(--aya-shadow-card);
  transition: transform .18s cubic-bezier(.22,1,.36,1),
              box-shadow .18s cubic-bezier(.22,1,.36,1),
              border-color .18s ease;
  will-change: transform;
}

.rate-card-premium:hover {
  transform: translateY(-2px);
  box-shadow: var(--aya-shadow-card-hover);
  border-color: rgba(59,130,246,.20);
}

html.dark .rate-card-premium:hover {
  border-color: rgba(59,130,246,.25);
}

.rate-card-best {
  border: 1.5px solid var(--aya-border-card-best);
  box-shadow: var(--aya-shadow-card-best);
}

.rate-card-best:hover {
  box-shadow: 0 16px 56px rgba(37,99,235,.16), 0 4px 12px rgba(37,99,235,.08);
  border-color: rgba(59,130,246,.38);
}

.rate-card-indicative {
  opacity: .78;
}

/* ─── Unified "Send Now" CTA Buttons ────────────────────────── */
.send-now-btn,
.aya-cta-btn {
  background: linear-gradient(160deg, #3b82f6 0%, #2563eb 60%, #1d4ed8 100%);
  box-shadow: var(--aya-shadow-btn);
  border-radius: var(--aya-r-btn);
  color: #fff;
  font-family: var(--aya-font);
  font-weight: 700;
  letter-spacing: .025em;
  transition: transform .15s cubic-bezier(.22,1,.36,1),
              box-shadow .15s cubic-bezier(.22,1,.36,1);
  -webkit-tap-highlight-color: transparent;
}

.send-now-btn:hover,
.aya-cta-btn:hover {
  box-shadow: var(--aya-shadow-btn-hover);
  transform: translateY(-1px);
}

.send-now-btn:active,
.aya-cta-btn:active {
  transform: translateY(0) scale(.98);
  box-shadow: 0 2px 8px rgba(37,99,235,.28);
}

/* Arrow micro-animation */
.aya-cta-arrow {
  transition: transform .15s cubic-bezier(.22,1,.36,1);
  display: inline-flex;
}
.send-now-btn:hover .aya-cta-arrow,
.aya-cta-btn:hover .aya-cta-arrow {
  transform: translateX(4px);
}

/* ─── Provider Logo Container ────────────────────────────────── */
.provider-logo-container {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: linear-gradient(145deg, #f8fafc, #f1f5f9);
  border: 1px solid rgba(226,232,240,.85);
  box-shadow: 0 1px 4px rgba(15,23,42,.06);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}

html.dark .provider-logo-container {
  background: linear-gradient(145deg, rgba(30,41,59,.9), rgba(15,23,42,.7));
  border-color: rgba(51,65,85,.6);
}

/* ─── Intelligence / Recommendation Card ─────────────────────── */
.aya-intelligence-card {
  background: linear-gradient(160deg, #fcfeff 0%, #f4f9ff 45%, #eaf4ff 100%);
  border: 1.5px solid rgba(59,130,246,.18);
  border-radius: 20px;
  box-shadow: 0 4px 24px rgba(37,99,235,.08), 0 1px 6px rgba(37,99,235,.04);
  animation: ayaCardReveal 300ms cubic-bezier(.22,1,.36,1) forwards;
}

html.dark .aya-intelligence-card {
  background: linear-gradient(160deg, rgba(30,41,59,.95) 0%, rgba(23,37,84,.50) 100%);
  border-color: rgba(59,130,246,.22);
  box-shadow: 0 4px 28px rgba(37,99,235,.14), 0 1px 6px rgba(0,0,0,.18);
}

@keyframes ayaCardReveal {
  from { opacity: 0; transform: translateY(6px) scale(.99); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ─── Confidence / Source Badges ─────────────────────────────── */
/* Live — green */
.aya-badge-live {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: var(--aya-r-badge);
  font-size: 9px; font-weight: 700;
  background: rgba(220,252,231,.75); color: #15803d;
  border: 1px solid rgba(134,239,172,.45);
}
/* Checked — amber */
.aya-badge-checked {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: var(--aya-r-badge);
  font-size: 9px; font-weight: 700;
  background: rgba(255,237,213,.80); color: #c2410c;
  border: 1px solid rgba(251,146,60,.35);
}
/* Estimated — yellow */
.aya-badge-estimated {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: var(--aya-r-badge);
  font-size: 9px; font-weight: 600;
  background: rgba(254,243,199,.75); color: #92400e;
  border: 1px solid rgba(253,211,77,.40);
}

/* ─── Receive Amount Typography ──────────────────────────────── */
.rc-amount {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}

/* ─── Popular Corridor Cards ─────────────────────────────────── */
.popular-corridor-card {
  background: var(--aya-bg-card);
  border: 1px solid var(--aya-border-card);
  border-radius: 18px;
  box-shadow: var(--aya-shadow-card);
  transition: transform .16s cubic-bezier(.22,1,.36,1),
              box-shadow .16s cubic-bezier(.22,1,.36,1);
}
.popular-corridor-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--aya-shadow-card-md);
}
.popular-corridor-card:active {
  transform: translateY(-1px);
}

/* ─── Global Navigation Header ───────────────────────────────── */
header, nav.site-nav, .site-header {
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
}

/* ─── Alert / Price Alert Modal ──────────────────────────────── */
#alert-modal .alert-modal-card,
.alert-modal-inner {
  border-radius: var(--aya-r-modal);
  box-shadow: 0 24px 80px rgba(15,23,42,.18), 0 4px 16px rgba(15,23,42,.08);
}

html.dark #alert-modal .alert-modal-card,
html.dark .alert-modal-inner {
  box-shadow: 0 24px 80px rgba(0,0,0,.48), 0 4px 16px rgba(0,0,0,.24);
}

/* Threshold buttons */
.threshold-btn {
  font-family: var(--aya-font);
  transition: all .14s ease;
}
.threshold-btn.active,
.threshold-btn[data-active="true"] {
  background: linear-gradient(135deg, #eff6ff, #dbeafe);
  border-color: var(--aya-blue);
  color: var(--aya-blue-dark);
  box-shadow: 0 2px 8px rgba(37,99,235,.14);
}

/* ─── Form Inputs — Premium Refinement ───────────────────────── */
input[type="number"],
input[type="email"],
input[type="text"],
select {
  font-family: var(--aya-font);
}

/* ─── Best Rate Badge (top ribbon) ──────────────────────────── */
.best-rate-ribbon {
  background: linear-gradient(135deg, #2563eb, #3b82f6);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #fff;
  box-shadow: 0 4px 14px rgba(37,99,235,.32);
  border-radius: 0 0 14px 14px;
  padding: 5px 18px;
}

/* ─── Savings / Insight Rows ─────────────────────────────────── */
.best-savings-msg {
  border-radius: 14px;
}

/* ─── Delivery Badge Chip ────────────────────────────────────── */
.delivery-chip {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 500; color: #475569;
}
.delivery-chip svg { color: #3b82f6; }

/* ─── Smart Provider Badges ──────────────────────────────────── */
.smart-badge {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 2px 8px; border-radius: 6px;
  font-size: 9px; font-weight: 700;
  letter-spacing: .03em;
}
.smart-badge-fastest {
  background: linear-gradient(135deg, #dbeafe, #e0e7ff);
  color: #4338ca;
}
.smart-badge-trending {
  background: #dcfce7; color: #15803d;
}
.smart-badge-dropping {
  background: #fee2e2; color: #b91c1c;
}

/* ─── Rate Trend Sparkline Row ───────────────────────────────── */
#trend-sparkline-row {
  border-radius: 14px;
  background: var(--aya-bg-subtle);
  border: 1px solid var(--aya-border-card);
}

/* ─── Mobile Optimizations ───────────────────────────────────── */
@media (max-width: 390px) {
  .rate-card-premium {
    border-radius: 18px;
  }
  .send-now-btn,
  .aya-cta-btn {
    font-size: 12px;
    padding: 10px 18px;
  }
  .rc-amount {
    font-size: 22px !important;
  }
}

@media (max-width: 480px) {
  .aya-intelligence-card {
    border-radius: 18px;
  }
}

/* ─── Scroll Reveal Lift ─────────────────────────────────────── */
@keyframes cardLiftIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ─── Trust / Compliance Strip ───────────────────────────────── */
.trust-strip {
  border-top: 1px solid var(--aya-border-card);
}

/* ─── Interstitial / Handoff Page ────────────────────────────── */
.handoff-premium-card {
  background: #ffffff;
  border: 1px solid rgba(214,222,234,.70);
  border-radius: 28px;
  box-shadow: 0 24px 80px rgba(15,23,42,.10), 0 4px 16px rgba(15,23,42,.06);
}

html.dark .handoff-premium-card {
  background: #1e293b;
  border-color: rgba(51,65,85,.60);
  box-shadow: 0 24px 80px rgba(0,0,0,.40), 0 4px 16px rgba(0,0,0,.20);
}

.handoff-corridor-pill {
  background: linear-gradient(135deg, #f8faff, #f0f5ff);
  border: 1px solid rgba(59,130,246,.12);
  border-radius: 20px;
}

html.dark .handoff-corridor-pill {
  background: linear-gradient(135deg, rgba(30,41,59,.80), rgba(23,37,84,.40));
  border-color: rgba(59,130,246,.20);
}

.handoff-amount-display {
  background: linear-gradient(135deg, #eff6ff, #dbeafe);
  border: 1px solid rgba(59,130,246,.15);
  border-radius: 18px;
}

html.dark .handoff-amount-display {
  background: linear-gradient(135deg, rgba(37,99,235,.12), rgba(29,78,216,.08));
  border-color: rgba(59,130,246,.20);
}

/* ─── Country Picker Modal Upgrades ──────────────────────────── */
.country-picker-overlay {
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* ─── Widget / B2B Embed ─────────────────────────────────────── */
.widget-embed-card {
  border-radius: var(--aya-r-card);
  box-shadow: var(--aya-shadow-card-md);
  border: 1px solid var(--aya-border-card);
}

/* ─── Dark Mode Provider Card ────────────────────────────────── */
html.dark .rate-card-premium {
  background: rgba(30,41,59,.96);
}
html.dark .rate-card-best {
  background: linear-gradient(160deg, rgba(30,41,59,.98) 0%, rgba(23,37,84,.20) 100%);
}

/* ─── Section Divider Label ──────────────────────────────────── */
.providers-section-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #94a3b8;
}

/* ─── All-Providers Send-Now Buttons — Unified Blue ──────────── */
/* Override the dark-slate send now button with blue for all cards */
.rate-card-premium .send-now-btn {
  background: linear-gradient(160deg, #3b82f6 0%, #2563eb 60%, #1d4ed8 100%);
  box-shadow: var(--aya-shadow-btn);
}
.rate-card-premium .send-now-btn:hover {
  box-shadow: var(--aya-shadow-btn-hover);
}

/* ─── Personalized Banner ────────────────────────────────────── */
#aya-personalized-banner > div {
  background: var(--aya-bg-subtle);
  border-color: var(--aya-border-card);
  border-radius: 14px;
  font-family: var(--aya-font);
}

html.dark #aya-personalized-banner > div {
  background: rgba(30,41,59,.60);
}

/* ─── Timing Insight Strip ───────────────────────────────────── */
#aya-timing-strip {
  font-family: var(--aya-font);
  border-radius: 12px;
}

/* ─── Alert Button (Create Rate Alert) ───────────────────────── */
.alert-trigger-btn {
  font-family: var(--aya-font);
  font-weight: 600;
  transition: all .15s ease;
}

/* ─── Parity Result / Re-quote Modal ────────────────────────── */
#rate-changed-modal,
.rate-parity-modal {
  border-radius: var(--aya-r-modal);
  box-shadow: 0 24px 80px rgba(15,23,42,.20);
}

/* ─── Conversion Prompt (Post-Handoff) ───────────────────────── */
.conversion-prompt-card {
  border-radius: var(--aya-r-card);
  box-shadow: var(--aya-shadow-card-md);
}

/* ─── SEO / Corridor Landing Upgrade ────────────────────────── */
.corridor-hero-card {
  border-radius: 24px;
  box-shadow: var(--aya-shadow-card-md);
}

/* ─── Smooth page entry ──────────────────────────────────────── */
.htmx-settling .rate-card-premium,
.htmx-settling .aya-intelligence-card {
  animation: cardLiftIn 220ms cubic-bezier(.22,1,.36,1) forwards;
}

/* ─── Quick-Action Cards — Cascade-final gradient fix ────────── */
/* Tailwind purges unused gradient classes; define explicitly here */
.quick-action-card {
  position: relative;
  overflow: hidden;
  will-change: transform;
  -webkit-tap-highlight-color: transparent;
}
.quick-action-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(155deg, rgba(255,255,255,0.18) 0%, transparent 55%);
  pointer-events: none;
  border-radius: inherit;
}
.quick-action-card > * { position: relative; z-index: 1; }
.quick-action-card span { color: #ffffff !important; font-weight: 700 !important; }
.quick-action-card svg { stroke: #ffffff !important; }

.quick-action-card:nth-child(1) {
  background: linear-gradient(140deg, #60a5fa 0%, #3b82f6 40%, #1d4ed8 100%) !important;
  box-shadow: 0 6px 22px rgba(37,99,235,.38), 0 2px 6px rgba(37,99,235,.20),
              inset 0 1px 0 rgba(255,255,255,.16) !important;
}
.quick-action-card:nth-child(2) {
  background: linear-gradient(140deg, #6ee7b7 0%, #10b981 40%, #047857 100%) !important;
  box-shadow: 0 6px 22px rgba(16,185,129,.38), 0 2px 6px rgba(16,185,129,.20),
              inset 0 1px 0 rgba(255,255,255,.16) !important;
}
.quick-action-card:nth-child(3) {
  background: linear-gradient(140deg, #c4b5fd 0%, #8b5cf6 40%, #6d28d9 100%) !important;
  box-shadow: 0 6px 22px rgba(139,92,246,.38), 0 2px 6px rgba(139,92,246,.20),
              inset 0 1px 0 rgba(255,255,255,.16) !important;
}
.quick-action-card:nth-child(4) {
  background: linear-gradient(140deg, #fde68a 0%, #f59e0b 40%, #b45309 100%) !important;
  box-shadow: 0 6px 22px rgba(245,158,11,.38), 0 2px 6px rgba(245,158,11,.20),
              inset 0 1px 0 rgba(255,255,255,.16) !important;
}

.quick-action-card:hover { transform: translateY(-3px) scale(1.025); }
.quick-action-card:nth-child(1):hover {
  box-shadow: 0 16px 40px rgba(37,99,235,.54), 0 4px 12px rgba(37,99,235,.28),
              inset 0 1px 0 rgba(255,255,255,.20) !important;
}
.quick-action-card:nth-child(2):hover {
  box-shadow: 0 16px 40px rgba(16,185,129,.54), 0 4px 12px rgba(16,185,129,.28),
              inset 0 1px 0 rgba(255,255,255,.20) !important;
}
.quick-action-card:nth-child(3):hover {
  box-shadow: 0 16px 40px rgba(139,92,246,.54), 0 4px 12px rgba(139,92,246,.28),
              inset 0 1px 0 rgba(255,255,255,.20) !important;
}
.quick-action-card:nth-child(4):hover {
  box-shadow: 0 16px 40px rgba(245,158,11,.54), 0 4px 12px rgba(245,158,11,.28),
              inset 0 1px 0 rgba(255,255,255,.20) !important;
}
.quick-action-card:active { transform: translateY(0) scale(.97) !important; }

/* Icon circles inside action cards */
.quick-action-card > div.w-10.h-10,
.quick-action-card > div.rounded-full {
  background: rgba(255,255,255,.24) !important;
}

/* ─── Recharge CTA Buttons — upgraded depth ──────────────────── */
#find-operators-btn,
#stripe-confirm-btn {
  background: linear-gradient(160deg, #34d399 0%, #10b981 55%, #059669 100%) !important;
  box-shadow: 0 5px 20px rgba(16,185,129,.42), 0 1px 5px rgba(16,185,129,.22),
              inset 0 1px 0 rgba(255,255,255,.20) !important;
  font-weight: 700 !important;
  letter-spacing: .025em;
  transition: transform .15s cubic-bezier(.22,1,.36,1),
              box-shadow .15s cubic-bezier(.22,1,.36,1);
}
#find-operators-btn:hover,
#stripe-confirm-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 30px rgba(16,185,129,.58), 0 2px 8px rgba(16,185,129,.28),
              inset 0 1px 0 rgba(255,255,255,.22) !important;
}
#find-operators-btn:active,
#stripe-confirm-btn:active {
  transform: translateY(0) scale(.98);
  box-shadow: 0 2px 10px rgba(16,185,129,.28) !important;
}

/* ─── Operator rows — lift on hover ──────────────────────────── */
#operators-card button {
  transition: transform .14s cubic-bezier(.22,1,.36,1),
              box-shadow .14s ease,
              border-color .14s ease,
              background-color .14s ease !important;
}
#operators-card button:hover {
  transform: translateX(3px) !important;
  border-color: rgba(16,185,129,.50) !important;
  background-color: rgba(240,253,244,.85) !important;
  box-shadow: 0 4px 14px rgba(16,185,129,.12) !important;
}
html.dark #operators-card button:hover {
  background-color: rgba(16,185,129,.07) !important;
}
#operators-card button:active { transform: translateX(1px) scale(.99) !important; }

/* ─── Amount tiles — bounce on hover ────────────────────────── */
#products-card button {
  transition: transform .13s cubic-bezier(.22,1,.36,1),
              box-shadow .13s ease,
              border-color .13s ease,
              background-color .13s ease !important;
}
#products-card button:hover {
  transform: translateY(-2px) scale(1.025) !important;
  border-color: rgba(16,185,129,.55) !important;
  background-color: rgba(240,253,244,.9) !important;
  box-shadow: 0 8px 20px rgba(16,185,129,.16) !important;
}
html.dark #products-card button:hover {
  background-color: rgba(16,185,129,.08) !important;
}
#products-card button:active { transform: scale(.97) !important; }

/* ─── Family Hub FAB ─────────────────────────────────────────── */
#family-hub-page .fixed.rounded-full {
  box-shadow: 0 8px 28px rgba(37,99,235,.50), 0 2px 8px rgba(37,99,235,.24) !important;
}

/* ─── Empty state dashed borders ────────────────────────────── */
[class*="border-dashed"] {
  border: 1.5px dashed rgba(148,163,184,.55) !important;
  transition: border-color .16s ease, background-color .16s ease;
}
[class*="border-dashed"]:hover {
  border-color: rgba(59,130,246,.45) !important;
  background-color: rgba(239,246,255,.6) !important;
}
html.dark [class*="border-dashed"] {
  border-color: rgba(71,85,105,.55) !important;
}

/* ─── Bottom nav blur glass ──────────────────────────────────── */
.fixed.bottom-0.inset-x-0,
.fixed.bottom-0.left-0.right-0 {
  backdrop-filter: blur(22px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(22px) saturate(180%) !important;
}
html.dark .fixed.bottom-0.inset-x-0,
html.dark .fixed.bottom-0.left-0.right-0 {
  background: rgba(10,15,28,.94) !important;
}

/* ═══════════════════════════════════════════════════════════════
   AyaSend Premium v4 — Design System Extensions
   Scroll-reveal · Dark-mode text fixes · Form polish ·
   Typography · Touch improvements · Premium transitions
   ═══════════════════════════════════════════════════════════════ */

/* ─── Design Token Extensions ────────────────────────────────── */
:root {
  --aya-teal:         #0F9D7C;
  --aya-teal-mid:     #0a7c62;
  --aya-teal-light:   rgba(15,157,124,.10);
  --aya-teal-ring:    rgba(15,157,124,.28);
  --aya-purple:       #a855f7;
  --aya-purple-mid:   #7c3aed;
  --aya-purple-light: rgba(168,85,247,.10);
  --aya-transition-fast:   120ms cubic-bezier(.22,1,.36,1);
  --aya-transition-std:    200ms cubic-bezier(.22,1,.36,1);
  --aya-transition-enter:  280ms cubic-bezier(.22,1,.36,1);
}

/* ─── Scroll-Reveal System ───────────────────────────────────── */
/* Add class="aya-reveal" to any element. JS adds .aya-reveal-visible
   when it crosses into the viewport. stagger siblings with nth-child
   delay classes below. */
.aya-reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity var(--aya-transition-enter),
              transform var(--aya-transition-enter);
}
.aya-reveal-visible {
  opacity: 1;
  transform: translateY(0);
}
/* Stagger delays (applies when .aya-reveal-visible is set) */
.aya-reveal:nth-child(2)  { transition-delay: 40ms; }
.aya-reveal:nth-child(3)  { transition-delay: 80ms; }
.aya-reveal:nth-child(4)  { transition-delay:120ms; }
.aya-reveal:nth-child(5)  { transition-delay:160ms; }
.aya-reveal:nth-child(6)  { transition-delay:200ms; }
/* Horizontal variant */
.aya-reveal-x {
  opacity: 0;
  transform: translateX(10px);
  transition: opacity var(--aya-transition-enter),
              transform var(--aya-transition-enter);
}
.aya-reveal-x.aya-reveal-visible { opacity:1; transform:translateX(0); }
@media (prefers-reduced-motion: reduce) {
  .aya-reveal, .aya-reveal-x {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}

/* ─── Dark Mode Text Overrides (rate table inline styles) ───── */
/* Overrides hardcoded color:#0f172a in rate_table.html */
html.dark #rates h3,
html.dark #rates h2 { color: #f1f5f9 !important; }
html.dark #rates > div p[style*="color:#0f172a"],
html.dark #rates > div p[style*="color: #0f172a"] { color: #e2e8f0 !important; }
html.dark #rates > div p[style*="color:#94a3b8"],
html.dark #rates > div p[style*="color: #94a3b8"] { color: #64748b !important; }
html.dark #rates > div p[style*="color:#64748b"],
html.dark #rates > div p[style*="color: #64748b"] { color: #94a3b8 !important; }
/* Corridor badge pill dark */
html.dark #rates span[style*="background:rgba(241,245,249"] {
  background: rgba(30,41,59,.80) !important;
  border-color: rgba(51,65,85,.60) !important;
  color: #94a3b8 !important;
}

/* ─── Premium Input Focus States ─────────────────────────────── */
/* Consistent ring across all inputs/selects/textareas */
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: none !important;
  box-shadow: 0 0 0 2.5px rgba(59,130,246,.30) !important;
  border-color: rgba(59,130,246,.55) !important;
  transition: box-shadow var(--aya-transition-fast),
              border-color var(--aya-transition-fast);
}
html.dark input:focus-visible,
html.dark select:focus-visible,
html.dark textarea:focus-visible {
  box-shadow: 0 0 0 2.5px rgba(59,130,246,.35) !important;
  border-color: rgba(59,130,246,.50) !important;
}
/* Amount input special: teal ring on recharge/data flows */
.recharge-input:focus-visible,
.aya-amount-input:focus-visible {
  box-shadow: 0 0 0 2.5px var(--aya-teal-ring) !important;
  border-color: var(--aya-teal) !important;
}

/* ─── View Toggle (rate table) ───────────────────────────────── */
.view-toggle-btn {
  font-family: var(--aya-font) !important;
  border-radius: 8px !important;
  transition: background var(--aya-transition-fast),
              color var(--aya-transition-fast),
              box-shadow var(--aya-transition-fast) !important;
  -webkit-tap-highlight-color: transparent;
}
.view-toggle-btn.active {
  background: #ffffff !important;
  color: #1e293b !important;
  box-shadow: 0 1px 4px rgba(15,23,42,.10) !important;
}
html.dark .view-toggle-btn.active {
  background: rgba(30,41,59,.95) !important;
  color: #f1f5f9 !important;
  box-shadow: 0 1px 4px rgba(0,0,0,.25) !important;
}
html.dark .view-toggle-btn:not(.active) {
  color: #475569 !important;
}

/* ─── Navigation & Header Glass ──────────────────────────────── */
/* Ensure nav stays crisp at any background */
header nav,
.site-header nav,
nav.site-nav {
  -webkit-font-smoothing: antialiased;
}
/* Top nav link underline hover — reuse global.css pattern */
nav a.nav-link {
  position: relative;
  transition: color var(--aya-transition-fast);
}
nav a.nav-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0; right: 0;
  height: 2px;
  border-radius: 2px;
  background: var(--aya-blue-500);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform var(--aya-transition-std);
}
nav a.nav-link:hover::after,
nav a.nav-link[aria-current="page"]::after { transform: scaleX(1); }

/* ─── Page Transition ────────────────────────────────────────── */
/* Applied to main content container on every navigation */
.page-content {
  animation: ayaPageIn 220ms cubic-bezier(.22,1,.36,1) both;
}
@keyframes ayaPageIn {
  from { opacity: 0; transform: translateY(5px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ─── HTMX swap animation ────────────────────────────────────── */
.htmx-swapping { opacity: 0; transform: translateY(4px); transition: opacity .15s ease, transform .15s ease; }
.htmx-settling  { animation: ayaPageIn 240ms cubic-bezier(.22,1,.36,1) both; }

/* ─── Skeleton Loaders — Refined ─────────────────────────────── */
.shimmer, .aya-shimmer {
  border-radius: 8px !important;
  overflow: hidden;
}
.shimmer::after, .aya-shimmer::after { display: none; }
/* Deeper dark-mode shimmer */
html.dark .shimmer,
html.dark .aya-shimmer {
  background: linear-gradient(
    90deg,
    rgba(30,41,59,.70) 0%,
    rgba(51,65,85,.55) 45%,
    rgba(30,41,59,.70) 100%
  ) !important;
  background-size: 1200px 100% !important;
  animation: shimmerScan 1.5s ease-in-out infinite !important;
}

/* ─── Premium Card Surfaces ──────────────────────────────────── */
/* Subtle inset top-light for lift illusion */
.rate-card-premium,
.popular-corridor-card {
  box-shadow:
    var(--aya-shadow-card),
    inset 0 1px 0 rgba(255,255,255,.70) !important;
}
html.dark .rate-card-premium,
html.dark .popular-corridor-card {
  box-shadow:
    var(--aya-shadow-card),
    inset 0 1px 0 rgba(255,255,255,.04) !important;
}
.rate-card-best {
  box-shadow:
    var(--aya-shadow-card-best),
    inset 0 1px 0 rgba(255,255,255,.85) !important;
}
html.dark .rate-card-best {
  box-shadow:
    var(--aya-shadow-card-best),
    inset 0 1px 0 rgba(255,255,255,.06) !important;
}

/* ─── Touch Target Enforcement (WCAG 2.5.5) ─────────────────── */
/* Minimum 44px for all interactive elements on touch screens */
@media (pointer: coarse) {
  button, a, [role="button"] {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }
  /* Exception: inline text links */
  p a, li a, span a { min-height: unset; display: inline; }
}

/* ─── Typography Refinement ──────────────────────────────────── */
/* Financial figures: always tabular, antialiased */
[data-amount], .aya-amount, .rc-amount,
strong[class*="amount"], b[class*="amount"] {
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum' 1;
  -webkit-font-smoothing: antialiased;
}
/* Money gradient text utility */
.aya-text-money {
  background: linear-gradient(135deg, #059669, #10b981);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ─── Success / Error State Animations ───────────────────────── */
@keyframes ayaSuccessScale {
  0%   { transform: scale(.6); opacity: 0; }
  55%  { transform: scale(1.08); opacity: 1; }
  80%  { transform: scale(.96); }
  100% { transform: scale(1); }
}
@keyframes ayaErrorShake {
  0%,100% { transform: translateX(0); }
  20%      { transform: translateX(-6px); }
  40%      { transform: translateX(6px); }
  60%      { transform: translateX(-4px); }
  80%      { transform: translateX(4px); }
}
.aya-success-pop { animation: ayaSuccessScale 380ms cubic-bezier(.22,1,.36,1) both; }
.aya-error-shake { animation: ayaErrorShake 400ms ease both; }

/* ─── Premium Loading Indicator ──────────────────────────────── */
/* Replaces generic spinner with branded pulse */
@keyframes ayaPulseRing {
  0%   { transform: scale(.88); opacity: 1; }
  100% { transform: scale(1.20); opacity: 0; }
}
.aya-loader-ring {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.aya-loader-ring::before {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid var(--aya-blue-500);
  animation: ayaPulseRing 1.2s ease-out infinite;
  opacity: 0;
}

/* ─── Corridor Card Entry Stagger ────────────────────────────── */
.popular-corridor-card:nth-child(1) { animation-delay:  20ms; }
.popular-corridor-card:nth-child(2) { animation-delay:  55ms; }
.popular-corridor-card:nth-child(3) { animation-delay:  90ms; }
.popular-corridor-card:nth-child(4) { animation-delay: 125ms; }
.popular-corridor-card:nth-child(5) { animation-delay: 160ms; }
.popular-corridor-card:nth-child(6) { animation-delay: 195ms; }

/* ─── Safe Area / Notch Support ──────────────────────────────── */
/* Bottom nav safe area */
.fixed.bottom-0.inset-x-0,
.fixed.bottom-0.left-0.right-0 {
  padding-bottom: max(env(safe-area-inset-bottom), 8px);
}
/* Top safe area for status bar on PWA */
.site-header, header {
  padding-top: env(safe-area-inset-top, 0px);
}

/* ─── Overscroll Prevention (iOS Safari) ─────────────────────── */
html, body {
  overscroll-behavior: none;
}
/* Allow scroll within scroll containers */
.overflow-y-auto, .overflow-y-scroll,
[data-scroll="true"] {
  overscroll-behavior: contain;
}

/* ─── Dark mode background base ──────────────────────────────── */
html.dark body {
  background-color: #080e1a;
}
html.dark {
  color-scheme: dark;
}

/* ─── Premium Dividers ───────────────────────────────────────── */
.aya-divider {
  height: 1px;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(226,232,240,.80) 20%,
    rgba(226,232,240,.80) 80%,
    transparent 100%);
  border: none;
}
html.dark .aya-divider {
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(51,65,85,.60) 20%,
    rgba(51,65,85,.60) 80%,
    transparent 100%);
}

/* ─── Accessible focus ring (universal) ─────────────────────── */
:focus-visible {
  outline: 2px solid var(--aya-blue-500);
  outline-offset: 2px;
  border-radius: 6px;
}
/* Override for elements that handle their own focus style */
.aya-cta-btn:focus-visible,
.send-now-btn:focus-visible,
.rate-card-premium:focus-visible,
button.seg-btn:focus-visible,
button.at-card:focus-visible {
  outline: 2px solid var(--aya-blue-500);
  outline-offset: 3px;
  border-radius: 12px;
}

/* ─── Responsive Typography Scale ───────────────────────────── */
/* Fluid type for amounts on small screens */
@media (max-width: 375px) {
  .rc-amount, .aya-amount { font-size: clamp(20px, 5vw, 28px) !important; }
}

/* ─── Foldable / Large Screen ────────────────────────────────── */
@media (min-width: 1280px) {
  .rate-card-premium { border-radius: 24px; }
  .aya-intelligence-card { border-radius: 22px; }
}

/* ─── Glass utility ──────────────────────────────────────────── */
.aya-glass {
  background: rgba(255,255,255,.72);
  backdrop-filter: blur(18px) saturate(180%);
  -webkit-backdrop-filter: blur(18px) saturate(180%);
  border: 1px solid rgba(226,232,240,.55);
}
html.dark .aya-glass {
  background: rgba(15,23,42,.78);
  border-color: rgba(51,65,85,.50);
}

/* ─── Badge improvements ─────────────────────────────────────── */
/* Unified "Live" dot semantics */
.aya-badge-live::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #22c55e;
  flex-shrink: 0;
  animation: liveDot 2.8s ease-in-out infinite;
}
/* Ensure dark mode badge readability */
html.dark .aya-badge-live   { background: rgba(20,83,45,.45) !important; color: #86efac !important; border-color: rgba(134,239,172,.25) !important; }
html.dark .aya-badge-checked { background: rgba(124,45,18,.35) !important; color: #fdba74 !important; border-color: rgba(251,146,60,.25) !important; }
html.dark .aya-badge-estimated { background: rgba(120,53,15,.35) !important; color: #fcd34d !important; border-color: rgba(253,211,77,.25) !important; }

/* ─── Footer App Banner ──────────────────────────────────────── */
#pwa-download-banner {
  transition: opacity .3s ease, transform .3s cubic-bezier(.22,1,.36,1);
}
#pwa-download-banner.hiding {
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
}

/* ─── Smooth scroll ──────────────────────────────────────────── */
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

/* ─── Premium flow animations (recharge / data) ──────────────── */
@keyframes _aya-op-up {
  from { opacity:0; transform:translateY(18px) scale(.96); }
  to   { opacity:1; transform:translateY(0)    scale(1); }
}

/* Phone step card — dark mode */
html.dark #step-phone {
  background: #1e293b !important;
  box-shadow: 0 1px 4px rgba(0,0,0,.25) !important;
}

/* Operator card grid — dark mode name text */
html.dark .op-name  { color: #f1f5f9 !important; }
html.dark .op-sublabel { color: #475569 !important; }

/* "Who are you helping" family strip — dark mode label */
html.dark #recharge-page > div > p[style*="94a3b8"],
html.dark #data-page > div > p[style*="94a3b8"] {
  color: #64748b !important;
}

