/* ═══════════════════════════════════════════════════════════════════════════
   AfriLink Pay — Design System v1.0
   Dark · Neon · Glassmorphic · Africa-first
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Tokens ─────────────────────────────────────────────────────────────── */
:root {
  --bg:           #050508;
  --bg-card:      rgba(255,255,255,0.045);
  --bg-card-h:    rgba(255,255,255,0.075);
  --bg-input:     rgba(255,255,255,0.06);
  --bg-input-f:   rgba(255,255,255,0.09);
  --accent:       #00D26A;
  --accent-dim:   rgba(0,210,106,0.15);
  --accent-glow:  rgba(0,210,106,0.35);
  --gold:         #FFB000;
  --gold-dim:     rgba(255,176,0,0.15);
  --blue:         #0096FF;
  --t-hi:         #F2F3F5;
  --t-mid:        #9099AA;
  --t-low:        #555F72;
  --border:       rgba(255,255,255,0.07);
  --border-h:     rgba(255,255,255,0.14);
  --success:      #00D26A;
  --error:        #FF4D6A;
  --warn:         #FFB000;
  --r-sm:   10px;
  --r-md:   16px;
  --r-lg:   24px;
  --r-xl:   32px;
  --shadow-card: 0 1px 1px rgba(0,0,0,.4), 0 4px 24px rgba(0,0,0,.3);
  --t-fast:  150ms cubic-bezier(.4,0,.2,1);
  --t-base:  240ms cubic-bezier(.4,0,.2,1);
  --t-slow:  380ms cubic-bezier(.4,0,.2,1);
}

/* ── Reset ──────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Space Grotesk', system-ui, sans-serif;
  background: var(--bg); color: var(--t-hi);
  min-height: 100vh; overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, select { font-family: inherit; }
a { color: inherit; text-decoration: none; }
svg { display: block; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
img { display: block; max-width: 100%; }

/* ── Animated background ─────────────────────────────────────────────────── */
.bg-canvas {
  position: fixed; inset: 0; z-index: 0;
  overflow: hidden; pointer-events: none;
}
.bg-orb {
  position: absolute; border-radius: 50%;
  filter: blur(120px); opacity: .18;
  animation: drift 20s ease-in-out infinite alternate;
}
.orb-1 {
  width: 700px; height: 700px;
  background: radial-gradient(circle, #00D26A, transparent 70%);
  top: -200px; left: -200px; animation-duration: 22s;
}
.orb-2 {
  width: 500px; height: 500px;
  background: radial-gradient(circle, #0096FF, transparent 70%);
  top: 40%; right: -150px; animation-duration: 18s; animation-delay: -8s;
}
.orb-3 {
  width: 400px; height: 400px;
  background: radial-gradient(circle, #FFB000, transparent 70%);
  bottom: -100px; left: 30%; animation-duration: 25s; animation-delay: -14s;
}
@keyframes drift {
  from { transform: translate(0,0) scale(1); }
  to   { transform: translate(60px,40px) scale(1.12); }
}
.bg-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 40%, black, transparent);
}

/* ── Header ──────────────────────────────────────────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; gap: 1rem;
  padding: 0 clamp(1rem, 4vw, 3rem); height: 64px;
  background: rgba(5,5,8,.85); backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}
.logo { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.logo-icon {
  width: 32px; height: 32px; border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), #00a052);
  display: grid; place-items: center;
  font-family: 'Syne', sans-serif; font-weight: 800;
  font-size: .95rem; color: #050508;
}
.logo-text { font-family: 'Syne', sans-serif; font-weight: 800; font-size: 1.15rem; letter-spacing: -.02em; }
.logo-accent { color: var(--accent); }
.header-nav { margin-left: auto; display: flex; align-items: center; gap: .75rem; }
.nav-rates { display: flex; gap: 1rem; font-size: .75rem; color: var(--t-mid); }
.nav-rate-item { display: flex; gap: .3rem; }
.nav-rate-pair { color: var(--t-low); }

/* ── Layout ──────────────────────────────────────────────────────────────── */
.app-main {
  position: relative; z-index: 1;
  max-width: 1200px; margin: 0 auto;
  padding: clamp(1.5rem,4vw,3rem) clamp(1rem,4vw,3rem) 5rem;
  display: grid;
  grid-template-columns: 1fr 340px;
  grid-template-rows: auto 1fr;
  gap: 2rem;
  align-items: start;
}
@media (max-width: 900px) {
  .app-main { grid-template-columns: 1fr; }
  .side-panels { display: contents; }
}

/* ── Hero ────────────────────────────────────────────────────────────────── */
.hero { grid-column: 1 / -1; text-align: center; padding: 2.5rem 0 1.5rem; }
.hero-badge {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .35rem 1rem .35rem .75rem; border-radius: 100px;
  background: var(--accent-dim); border: 1px solid rgba(0,210,106,.25);
  font-size: .78rem; color: var(--accent); margin-bottom: 1.25rem;
}
.badge-dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--accent);
  animation: pulse-dot 2s ease infinite;
}
@keyframes pulse-dot {
  0%,100% { opacity: 1; transform: scale(1); }
  50%     { opacity: .5; transform: scale(.7); }
}
.hero-title {
  font-family: 'Syne', sans-serif;
  font-size: clamp(2.2rem,6vw,4rem); font-weight: 800;
  line-height: 1.1; letter-spacing: -.03em; margin-bottom: 1rem;
}
.gradient-text {
  background: linear-gradient(90deg, var(--accent) 0%, var(--gold) 55%, var(--blue) 100%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.hero-sub {
  font-size: clamp(.95rem,2vw,1.1rem); color: var(--t-mid);
  max-width: 560px; margin: 0 auto; line-height: 1.65;
}

/* ── Glass card ──────────────────────────────────────────────────────────── */
.glass-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 1.75rem;
  backdrop-filter: blur(24px); box-shadow: var(--shadow-card);
  transition: border-color var(--t-base);
}
.glass-card:focus-within { border-color: var(--border-h); }

/* ── Wizard ──────────────────────────────────────────────────────────────── */
.wizard-wrap { display: flex; flex-direction: column; gap: 0; min-height: 0; }

/* ── Step dots ───────────────────────────────────────────────────────────── */
.steps-row { display: flex; align-items: center; gap: 0; margin-bottom: 1.25rem; }
.step-dot {
  display: flex; flex-direction: column; align-items: center;
  gap: .25rem; padding: .5rem; background: none; border: none;
  cursor: pointer; flex-shrink: 0;
}
.step-num {
  width: 32px; height: 32px; border-radius: 50%;
  border: 2px solid var(--border);
  display: grid; place-items: center;
  font-size: .8rem; font-weight: 600; color: var(--t-low);
  transition: all var(--t-base);
}
.step-lbl { font-size: .7rem; color: var(--t-low); transition: color var(--t-base); }
.step-dot.active .step-num {
  border-color: var(--accent); background: var(--accent);
  color: #050508; box-shadow: 0 0 14px var(--accent-glow);
}
.step-dot.active .step-lbl { color: var(--accent); }
.step-dot.done .step-num { border-color: var(--accent); background: var(--accent-dim); color: var(--accent); }
.step-dot.done .step-lbl { color: var(--t-mid); }
.step-line { flex: 1; height: 2px; background: var(--border); border-radius: 2px; transition: background var(--t-base); }
.step-line.done { background: var(--accent); opacity: .5; }

/* ── Step panels ─────────────────────────────────────────────────────────── */
.step-panel { display: none; }
.step-panel.active { display: block; }
.step-panel[hidden] { display: none !important; }
.card-header { margin-bottom: 1.5rem; }
.card-header h2 {
  font-family: 'Syne', sans-serif;
  font-size: 1.35rem; font-weight: 700; letter-spacing: -.02em;
}
.card-sub { font-size: .82rem; color: var(--t-mid); margin-top: .25rem; }

/* ── Country selector ────────────────────────────────────────────────────── */
.corridor-row { display: flex; align-items: flex-end; gap: .75rem; margin-bottom: 1.5rem; }
.country-block { flex: 1; position: relative; }
.field-label {
  display: block; font-size: .75rem; font-weight: 500;
  color: var(--t-mid); margin-bottom: .4rem;
  letter-spacing: .04em; text-transform: uppercase;
}
.country-btn {
  width: 100%; display: flex; align-items: center; gap: .5rem;
  padding: .75rem 1rem; background: var(--bg-input);
  border: 1px solid var(--border); border-radius: var(--r-md);
  color: var(--t-hi); font-size: .95rem; font-weight: 500;
  transition: all var(--t-base); text-align: left;
}
.country-btn:hover, .country-btn:focus-visible {
  background: var(--bg-input-f); border-color: var(--border-h); outline: none;
}
.country-flag { font-size: 1.3rem; line-height: 1; flex-shrink: 0; }
.country-name { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chevron { width: 16px; height: 16px; flex-shrink: 0; color: var(--t-low); }
.country-dropdown {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 200;
  background: #0e1018; border: 1px solid var(--border-h);
  border-radius: var(--r-md); box-shadow: 0 8px 40px rgba(0,0,0,.6); overflow: hidden;
}
.country-dropdown.hidden { display: none; }
.dropdown-search-wrap { padding: .6rem; border-bottom: 1px solid var(--border); }
.dropdown-search {
  width: 100%; padding: .5rem .75rem;
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: var(--r-sm); color: var(--t-hi); font-size: .87rem; outline: none;
}
.dropdown-search:focus { border-color: var(--accent); }
.dropdown-list { max-height: 240px; overflow-y: auto; padding: .4rem; }
.dropdown-list::-webkit-scrollbar { width: 4px; }
.dropdown-list::-webkit-scrollbar-thumb { background: var(--border-h); border-radius: 2px; }
.dropdown-item {
  display: flex; align-items: center; gap: .65rem;
  padding: .55rem .75rem; border-radius: var(--r-sm);
  font-size: .88rem; cursor: pointer; transition: background var(--t-fast);
}
.dropdown-item:hover, .dropdown-item.focused { background: var(--bg-input-f); }
.dropdown-item.selected { color: var(--accent); }
.dropdown-flag { font-size: 1.1rem; }
.dropdown-name { flex: 1; }
.dropdown-ccy { font-size: .75rem; color: var(--t-low); }

/* ── Swap button ─────────────────────────────────────────────────────────── */
.swap-btn {
  width: 40px; height: 40px; flex-shrink: 0;
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: 50%; display: grid; place-items: center;
  color: var(--t-mid); transition: all var(--t-base);
}
.swap-btn svg { width: 18px; height: 18px; }
.swap-btn:hover {
  background: var(--accent-dim); border-color: var(--accent);
  color: var(--accent); transform: rotate(180deg);
}

/* ── Amount ──────────────────────────────────────────────────────────────── */
.amount-wrap { margin-bottom: 1.5rem; }
.amount-field {
  display: flex; align-items: center;
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: var(--r-md); overflow: hidden;
  transition: border-color var(--t-base);
}
.amount-field:focus-within { border-color: var(--accent); }
.amount-input {
  flex: 1; padding: 1rem 1.25rem;
  background: none; border: none; outline: none;
  color: var(--t-hi); font-size: 2rem; font-weight: 600;
  font-family: 'Space Grotesk', sans-serif; letter-spacing: -.03em; min-width: 0;
}
.amount-input::placeholder { color: var(--t-low); }
.amount-input::-webkit-outer-spin-button,
.amount-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.amount-input[type=number] { -moz-appearance: textfield; }
.amount-currency {
  padding: 0 1.25rem; font-size: .85rem; font-weight: 600;
  color: var(--t-mid); border-left: 1px solid var(--border);
  white-space: nowrap; letter-spacing: .05em;
}
.fx-strip {
  display: flex; align-items: center; gap: .75rem; flex-wrap: wrap;
  padding: .65rem 1.25rem;
  background: rgba(0,210,106,.05); border: 1px solid rgba(0,210,106,.15);
  border-top: none; border-radius: 0 0 var(--r-md) var(--r-md);
  font-size: .82rem; min-height: 2.5rem;
}
.fx-strip.hidden { display: none; }
.fx-receives { color: var(--accent); font-weight: 600; }
.fx-rate { color: var(--t-mid); }
.fx-badge {
  margin-left: auto; padding: .15rem .5rem;
  background: var(--accent-dim); color: var(--accent);
  border-radius: 100px; font-size: .7rem; font-weight: 600;
}

/* ── Payment method grid ─────────────────────────────────────────────────── */
.method-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: .75rem; margin-bottom: 1.5rem;
}
.method-tile {
  position: relative; padding: 1.1rem .9rem;
  background: var(--bg-input); border: 2px solid var(--border);
  border-radius: var(--r-md); cursor: pointer;
  transition: all var(--t-base); text-align: left;
}
.method-tile:hover { background: var(--bg-input-f); border-color: var(--border-h); transform: translateY(-2px); }
.method-tile.selected {
  border-color: var(--accent); background: var(--accent-dim);
  box-shadow: 0 0 20px rgba(0,210,106,.2);
}
.method-icon { font-size: 1.6rem; margin-bottom: .5rem; line-height: 1; }
.method-label { font-size: .82rem; font-weight: 600; color: var(--t-hi); line-height: 1.3; }
.method-speed { font-size: .7rem; color: var(--t-low); margin-top: .2rem; }
.method-tile.selected .method-speed { color: var(--accent); }
.method-check {
  position: absolute; top: .6rem; right: .6rem;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--accent); display: none;
  align-items: center; justify-content: center;
  font-size: .65rem; color: #050508; font-weight: 700;
}
.method-tile.selected .method-check { display: flex; }

/* ── Form fields ─────────────────────────────────────────────────────────── */
.field-stack { display: flex; flex-direction: column; gap: 1rem; margin-bottom: 1.5rem; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
@media (max-width: 480px) { .field-row { grid-template-columns: 1fr; } }
.field-group { display: flex; flex-direction: column; }
.field-input, .field-select {
  padding: .75rem 1rem;
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: var(--r-md); color: var(--t-hi);
  font-size: .9rem; font-family: inherit;
  outline: none; transition: all var(--t-base);
}
.field-input:focus, .field-select:focus {
  border-color: var(--accent); background: var(--bg-input-f);
}
.field-input::placeholder { color: var(--t-low); }
.field-select {
  appearance: none; cursor: pointer;
  /* Force browser to render option dropdown in a consistent scheme.
     Without this, Chrome uses OS dark-mode colours for <option> which may
     be invisible against the app's custom dark bg. */
  color-scheme: light dark;
}
/* Style <option> elements directly — works in Firefox/Safari; Chrome ignores
   background on <option> but the colour-scheme hint above helps there. */
.field-select option {
  background-color: #1a1d27;
  color: #f0f0f0;
}
[data-theme="light"] .field-select option {
  background-color: #fff;
  color: #0d1117;
}
/* Inline select widgets inside wizards (id-type picker, rail checklist etc.) */
select.field-select, select {
  color: var(--t-hi);
}
.optional { color: var(--t-low); font-size: .7rem; font-weight: 400; }

/* ── Summary ─────────────────────────────────────────────────────────────── */
.summary-flow {
  display: flex; align-items: center; gap: 1rem;
  padding: 1.5rem; margin-bottom: 1.25rem;
  background: rgba(255,255,255,.03); border: 1px solid var(--border);
  border-radius: var(--r-md);
}
.summary-col { flex: 1; text-align: center; }
.sum-label { font-size: .72rem; color: var(--t-low); text-transform: uppercase; letter-spacing: .06em; margin-bottom: .4rem; }
.sum-amount {
  font-family: 'Syne', sans-serif; font-size: 1.8rem;
  font-weight: 800; letter-spacing: -.04em;
}
.sum-amount.accent { color: var(--accent); }
.sum-ccy { font-size: .75rem; color: var(--t-mid); margin-top: .2rem; letter-spacing: .05em; }
.summary-arrow { flex-shrink: 0; }
.summary-arrow svg { width: 48px; height: 24px; color: var(--t-low); }
.summary-details { margin-bottom: 1.5rem; }
.detail-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: .65rem 0; border-bottom: 1px solid var(--border);
}
.detail-row:last-child { border-bottom: none; }
.detail-key { font-size: .82rem; color: var(--t-low); }
.detail-val { font-size: .85rem; font-weight: 500; }
.detail-val.success { color: var(--success); }

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn-primary {
  display: flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .85rem 1.5rem;
  background: var(--accent); color: #050508;
  font-weight: 700; font-size: .9rem;
  border-radius: var(--r-md); border: none;
  transition: all var(--t-base); cursor: pointer;
}
.btn-primary svg { width: 18px; height: 18px; stroke-width: 2.5; }
.btn-primary:hover { background: #00eb78; box-shadow: 0 0 24px var(--accent-glow); transform: translateY(-1px); }
.btn-primary:disabled { opacity: .4; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-primary.btn-full { width: 100%; }

.btn-accent {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  padding: .6rem 1.1rem;
  background: var(--accent); color: #050508;
  font-weight: 700; font-size: .83rem;
  border-radius: var(--r-sm); border: none; cursor: pointer;
  transition: all var(--t-base);
}
.btn-accent:hover { background: #00eb78; box-shadow: 0 0 16px var(--accent-glow); }
.btn-accent.btn-full { width: 100%; }
.btn-accent.btn-sm { padding: .45rem .9rem; font-size: .78rem; }

.btn-ghost {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  padding: .6rem 1.1rem;
  background: rgba(255,255,255,.06); color: var(--t-mid);
  font-weight: 500; font-size: .83rem;
  border-radius: var(--r-sm); border: 1px solid var(--border);
  cursor: pointer; transition: all var(--t-base);
}
.btn-ghost:hover { background: rgba(255,255,255,.1); color: var(--t-hi); border-color: var(--border-h); }
.btn-ghost.btn-sm { padding: .45rem .9rem; font-size: .78rem; }
.btn-ghost.btn-back { padding-left: .75rem; }
.btn-ghost.btn-full { width: 100%; }

.btn-icon {
  width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(255,255,255,.06); color: var(--t-mid);
  font-size: .85rem; border: none; cursor: pointer;
  transition: all var(--t-base);
}
.btn-icon:hover { background: rgba(255,255,255,.12); color: var(--t-hi); }

.btn-pay {
  position: relative; overflow: hidden; width: 100%; padding: 1.1rem;
  background: linear-gradient(135deg, var(--accent) 0%, #00a052 100%);
  color: #050508; font-weight: 800; font-size: 1.05rem;
  font-family: 'Syne', sans-serif;
  border-radius: var(--r-md); border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: .65rem;
  transition: all var(--t-base);
  box-shadow: 0 0 32px rgba(0,210,106,.3); letter-spacing: -.01em;
}
.btn-pay:hover { transform: translateY(-2px); box-shadow: 0 4px 48px rgba(0,210,106,.45); }
.btn-pay:active { transform: translateY(0); }
.btn-pay:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }
.pay-icon { width: 20px; height: 20px; flex-shrink: 0; }
.pay-shine {
  position: absolute; inset: 0;
  background: linear-gradient(105deg, transparent 40%, rgba(255,255,255,.18) 50%, transparent 60%);
  transform: translateX(-100%);
  animation: shine 3.5s ease-in-out infinite 1s;
}
@keyframes shine {
  0%  { transform: translateX(-100%); }
  40% { transform: translateX(100%); }
  100%{ transform: translateX(100%); }
}

.btn-row { display: flex; gap: .75rem; align-items: center; }
.btn-row .btn-primary { flex: 1; }

/* ── Result panel ────────────────────────────────────────────────────────── */
.result-panel { text-align: center; padding: 2.5rem 1.75rem; }
.result-icon-wrap { position: relative; width: 80px; height: 80px; margin: 0 auto 1.25rem; }
.result-ring {
  position: absolute; inset: 0; border-radius: 50%;
  border: 3px solid var(--accent);
  animation: ring-pulse 2s ease-out infinite;
}
@keyframes ring-pulse {
  0%   { transform: scale(1); opacity: .7; }
  100% { transform: scale(1.6); opacity: 0; }
}
.result-icon {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  width: 80px; height: 80px; border-radius: 50%;
  background: var(--accent-dim); border: 2px solid var(--accent);
  font-size: 2rem; color: var(--accent); font-weight: 700;
}
.result-title { font-family: 'Syne', sans-serif; font-size: 1.6rem; font-weight: 800; margin-bottom: .5rem; }
.result-sub { color: var(--t-mid); margin-bottom: .75rem; }
.result-txn { font-size: .75rem; color: var(--t-low); font-family: monospace; margin-bottom: 1.5rem; }
.result-actions { display: flex; gap: .75rem; justify-content: center; flex-wrap: wrap; }

/* ── Side panels ─────────────────────────────────────────────────────────── */
.side-panels {
  display: flex; flex-direction: column; gap: 1rem;
  grid-column: 2; grid-row: 2 / span 2; align-self: start;
  position: sticky; top: 80px;
}
.widget { padding: 1.25rem; }
.widget-hd { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.widget-hd h3 { font-size: .9rem; font-weight: 700; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); animation: pulse-dot 2s ease infinite; }
.module-count {
  font-size: .72rem; color: var(--accent);
  background: var(--accent-dim); padding: .15rem .5rem;
  border-radius: 100px; font-weight: 600;
}

/* ── Rates list ──────────────────────────────────────────────────────────── */
.rates-list { display: flex; flex-direction: column; gap: .5rem; }
.rate-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: .5rem .65rem;
  background: rgba(255,255,255,.03); border-radius: var(--r-sm);
}
.rate-pair { font-size: .78rem; color: var(--t-mid); font-family: monospace; }
.rate-val { font-size: .82rem; font-weight: 600; color: var(--t-hi); }
.rate-source { font-size: .68rem; color: var(--t-low); }
.rate-skeleton {
  height: 38px; border-radius: var(--r-sm);
  background: linear-gradient(90deg, rgba(255,255,255,.04) 25%, rgba(255,255,255,.08) 50%, rgba(255,255,255,.04) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease infinite;
}
@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── Compliance modules ──────────────────────────────────────────────────── */
.modules-list { display: flex; flex-direction: column; gap: .35rem; }
.module-row {
  display: flex; align-items: center; gap: .6rem;
  padding: .45rem .5rem; border-radius: var(--r-sm);
  font-size: .82rem; transition: background var(--t-fast);
}
.module-row:hover { background: rgba(255,255,255,.04); }
.module-name { flex: 1; color: var(--t-hi); }
.module-toggle {
  position: relative; width: 34px; height: 18px;
  background: var(--border-h); border-radius: 100px;
  cursor: pointer; transition: background var(--t-base); flex-shrink: 0;
}
.module-toggle.on { background: var(--accent); }
.module-toggle::after {
  content: ''; position: absolute; top: 2px; left: 2px;
  width: 14px; height: 14px; border-radius: 50%;
  background: #fff; transition: transform var(--t-base);
}
.module-toggle.on::after { transform: translateX(16px); }

/* ── Payment link / QR widget ───────────────────────────────────────────── */
.link-form { display: flex; flex-direction: column; gap: .75rem; }
.link-result { margin-top: .5rem; border-radius: var(--r-md); border: 1px solid var(--border); overflow: hidden; }
.link-result.hidden { display: none; }
.qr-wrap { padding: 1rem; display: flex; justify-content: center; background: #fff; border-radius: var(--r-sm); margin: .75rem; }
.qr-img { width: 160px; height: 160px; border-radius: 4px; }
.link-url-row { padding: .5rem .75rem; font-size: .72rem; color: var(--t-mid); word-break: break-all; border-top: 1px solid var(--border); }
.link-url-actions { display: flex; gap: .5rem; padding: .5rem .75rem; border-top: 1px solid var(--border); }
.badge-sm {
  font-size: .68rem; color: var(--gold);
  background: var(--gold-dim); padding: .15rem .5rem;
  border-radius: 100px; font-weight: 600;
}

/* ── Transactions list ───────────────────────────────────────────────────── */
.txn-list { display: flex; flex-direction: column; gap: .4rem; max-height: 300px; overflow-y: auto; }
.txn-item {
  display: flex; align-items: center; gap: .65rem;
  padding: .55rem .65rem; border-radius: var(--r-sm);
  background: rgba(255,255,255,.03); font-size: .8rem;
}
.txn-icon { font-size: 1.1rem; }
.txn-info { flex: 1; min-width: 0; }
.txn-corridor { color: var(--t-hi); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.txn-date { color: var(--t-low); font-size: .7rem; }
.txn-amount { font-weight: 600; white-space: nowrap; }
.txn-status-badge { font-size: .65rem; padding: .15rem .4rem; border-radius: 100px; font-weight: 600; }
.txn-status-badge.completed { background: rgba(0,210,106,.15); color: var(--accent); }
.txn-status-badge.pending   { background: rgba(255,176,0,.15);  color: var(--gold); }
.txn-status-badge.failed    { background: rgba(255,77,106,.15); color: var(--error); }
.empty-msg { font-size: .82rem; color: var(--t-low); text-align: center; padding: 1rem 0; }

/* ── Toast ───────────────────────────────────────────────────────────────── */
.toast-wrap {
  position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 999;
  display: flex; flex-direction: column; gap: .5rem; align-items: flex-end;
}
.toast {
  display: flex; align-items: center; gap: .75rem;
  padding: .75rem 1.1rem;
  background: #181b24; border: 1px solid var(--border-h);
  border-radius: var(--r-md); font-size: .85rem; font-weight: 500;
  box-shadow: 0 8px 32px rgba(0,0,0,.5);
  animation: toast-in var(--t-base) forwards; max-width: 340px;
}
.toast.success { border-left: 3px solid var(--success); }
.toast.error   { border-left: 3px solid var(--error); }
.toast.info    { border-left: 3px solid var(--blue); }
@keyframes toast-in {
  from { transform: translateX(20px); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}
.toast-out { animation: toast-out var(--t-base) forwards; }
@keyframes toast-out { to { transform: translateX(20px); opacity: 0; } }

/* ── Scrollbar ───────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.18); }

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .app-main { grid-template-columns: 1fr; gap: 1.5rem; }
  .side-panels { position: static; display: flex; flex-direction: column; gap: 1rem; }
  .nav-rates { display: none; }
  .hero { padding: 1.5rem 0 1rem; }
  .hero-title { font-size: clamp(1.8rem,8vw,2.8rem); }
}
@media (max-width: 480px) {
  .glass-card { padding: 1.25rem; }
  .corridor-row { gap: .5rem; }
  .amount-input { font-size: 1.5rem; }
  .method-grid { grid-template-columns: repeat(3, 1fr); }
  .summary-flow { padding: 1rem; gap: .75rem; }
  .sum-amount { font-size: 1.4rem; }
}

/* ── Utilities ───────────────────────────────────────────────────────────── */
.hidden { display: none !important; }
.success { color: var(--success); }
.error   { color: var(--error); }
.warn    { color: var(--warn); }

/* ══════════════════════════════════════════════════════════════════════════
   AfriLink Pay — v1.1 Additions
   Light Theme · Theme Toggle · Language Selector · RTL · Mobile Polish
   ══════════════════════════════════════════════════════════════════════════ */

/* ── Light theme token overrides ─────────────────────────────────────────── */
[data-theme="light"] {
  --bg:          #EFF1F6;
  --bg-card:     rgba(255,255,255,0.88);
  --bg-card-h:   rgba(255,255,255,0.97);
  --bg-input:    rgba(0,0,0,0.045);
  --bg-input-f:  rgba(0,0,0,0.075);
  --t-hi:        #0D1117;
  --t-mid:       #566075;
  --t-low:       #8B95A8;
  --border:      rgba(0,0,0,0.07);
  --border-h:    rgba(0,0,0,0.14);
  --shadow-card: 0 1px 1px rgba(0,0,0,.04), 0 4px 24px rgba(0,0,0,.09);
}
[data-theme="light"] body      { background: var(--bg); color: var(--t-hi); }
[data-theme="light"] .site-header { background: rgba(239,241,246,.92); }
[data-theme="light"] .bg-orb   { opacity: .055; }
[data-theme="light"] .bg-grid  {
  background-image:
    linear-gradient(rgba(0,0,0,.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,0,0,.04) 1px, transparent 1px);
}
[data-theme="light"] .country-dropdown { background: #fff; border-color: rgba(0,0,0,.12); }
[data-theme="light"] .toast            { background: #fff; border-color: rgba(0,0,0,.1); color: var(--t-hi); }
[data-theme="light"] .amount-input     { color: var(--t-hi); }
[data-theme="light"] .field-input,
[data-theme="light"] .field-select     { color: var(--t-hi); }
[data-theme="light"] .dropdown-search  { color: var(--t-hi); }
/* Dashboard overrides */
[data-theme="light"] .dash-topbar  { background: rgba(239,241,246,.92); }
[data-theme="light"] .dash-sidebar { background: rgba(255,255,255,.7); }

/* ── Theme toggle button ──────────────────────────────────────────────────── */
.theme-toggle {
  width: 36px; height: 36px; flex-shrink: 0;
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: var(--r-sm); font-size: 1rem; line-height: 1;
  display: grid; place-items: center; cursor: pointer;
  transition: all var(--t-base);
}
.theme-toggle:hover {
  background: var(--bg-input-f); border-color: var(--border-h);
  transform: rotate(22deg);
}

/* ── Language selector ────────────────────────────────────────────────────── */
.lang-select-wrap { position: relative; flex-shrink: 0; }
.lang-select {
  padding: .45rem .5rem; padding-right: 1.5rem;
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: var(--r-sm); color: var(--t-mid);
  font-size: .78rem; font-weight: 600; font-family: inherit;
  outline: none; cursor: pointer; transition: all var(--t-base);
  -webkit-appearance: none; appearance: none;
}
.lang-select:focus { border-color: var(--accent); color: var(--t-hi); }
.lang-select-wrap::after {
  content: '▾'; position: absolute; right: .45rem; top: 50%;
  transform: translateY(-50%); pointer-events: none;
  color: var(--t-low); font-size: .6rem;
}
[data-theme="light"] .lang-select option { background: #fff; color: #0D1117; }

/* ── Improved mobile header ───────────────────────────────────────────────── */
@media (max-width: 640px) {
  .site-header { padding: 0 .85rem; gap: .4rem; }
  .header-nav  { gap: .4rem; }
  .nav-rates   { display: none; }
}
@media (max-width: 400px) {
  #createLinkBtn { font-size: 0; padding: .45rem .7rem; }
  #createLinkBtn::after { content: '＋'; font-size: .95rem; }
}

/* ── RTL support (Arabic) ─────────────────────────────────────────────────── */
[dir="rtl"] .header-nav           { margin-left: 0; margin-right: auto; }
[dir="rtl"] .logo                  { flex-direction: row-reverse; }
[dir="rtl"] .corridor-row          { flex-direction: row-reverse; }
[dir="rtl"] .btn-row               { flex-direction: row-reverse; }
[dir="rtl"] .summary-flow          { flex-direction: row-reverse; }
[dir="rtl"] .detail-row            { flex-direction: row-reverse; }
[dir="rtl"] .widget-hd             { flex-direction: row-reverse; }
[dir="rtl"] .country-dropdown      { left: auto; right: 0; }
[dir="rtl"] .toast-wrap            { right: auto; left: 1.5rem; }
[dir="rtl"] .field-label           { text-align: right; }
[dir="rtl"] .amount-currency       { border-left: none; border-right: 1px solid var(--border); }
[dir="rtl"] .fx-badge              { margin-left: 0; margin-right: auto; }
[dir="rtl"] .summary-arrow svg     { transform: scaleX(-1); }
[dir="rtl"] .method-check          { right: auto; left: .6rem; }
[dir="rtl"] .module-row            { flex-direction: row-reverse; }

/* ── Small-screen wizard polish ───────────────────────────────────────────── */
@media (max-width: 480px) {
  .steps-row { padding: 0 .2rem; }
  .step-lbl  { font-size: .62rem; }
  .step-num  { width: 28px; height: 28px; font-size: .72rem; }
  .btn-pay   { font-size: .92rem; }
  /* Stack corridor on tiny screens */
  .corridor-row { flex-wrap: wrap; }
  .corridor-row .swap-btn { order: 3; margin: 0 auto; }
  .corridor-row .country-block:nth-child(3) { order: 2; }
  /* Summary stacks */
  .summary-flow { flex-direction: column; gap: .75rem; text-align: center; }
  .summary-arrow svg { transform: rotate(90deg); }
  [dir="rtl"] .summary-arrow svg { transform: rotate(90deg); }
}

/* ══════════════════════════════════════════════════════════════════════════
   AfriLink Pay — v1.2 Additions
   Full mobile responsiveness · Onboarding sections · Agent picker · KYC
   ══════════════════════════════════════════════════════════════════════════ */

/* ── Onboarding sections (merchant & agent on main website) ──────────────── */
.onboarding-section {
  width: 100%; box-sizing: border-box;
  border-top: 1px solid var(--border);
  padding: 2.5rem clamp(1rem, 4vw, 3rem);
  position: relative; z-index: 1;
}
.onboard-tabs {
  display: flex; gap: .5rem; margin-bottom: 1.5rem;
  flex-wrap: wrap;
}
.onboard-tab {
  padding: .55rem 1.1rem; border-radius: var(--r-sm);
  background: var(--bg-input); border: 1px solid var(--border);
  color: var(--t-mid); font-size: .85rem; font-weight: 600; cursor: pointer;
  transition: all var(--t-base);
}
.onboard-tab.active {
  background: var(--accent-dim); border-color: var(--accent); color: var(--accent);
}
.onboard-panel { display: none; }
.onboard-panel.active { display: block; }
.onboard-form {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1rem;
}
@media (max-width: 600px) {
  .onboard-form { grid-template-columns: 1fr; }
}

/* ── Agent picker ─────────────────────────────────────────────────────────── */
.agent-picker-box {
  margin-top: 1rem; padding: 1rem;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--r-md); box-sizing: border-box;
}
.agent-picker-title {
  font-size: .82rem; font-weight: 600; color: var(--t-mid);
  margin-bottom: .75rem; text-transform: uppercase; letter-spacing: .04em;
}
.agent-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: .65rem;
}
@media (max-width: 480px) {
  .agent-grid { grid-template-columns: 1fr 1fr; }
}

/* ── KYC section styling ──────────────────────────────────────────────────── */
#kycSection { margin-bottom: 1rem; }
#kycSection .field-stack { margin-bottom: 0; }

/* ── Stat value colours for merchant dashboard ───────────────────────────── */
.stat-value.gold { color: var(--gold); }
.stat-value.red  { color: var(--error); }

/* ── Comprehensive mobile overhaul — 360px to 640px ─────────────────────── */
@media (max-width: 640px) {
  /* Header */
  .site-header { padding: 0 .75rem; gap: .35rem; height: 56px; }
  .logo-text    { font-size: 1rem; }
  .header-nav   { gap: .3rem; }
  .btn-ghost.btn-sm { padding: .4rem .7rem; font-size: .78rem; }
  .btn-accent.btn-sm { padding: .4rem .7rem; font-size: .78rem; }

  /* Hero */
  .hero { padding: 1.25rem 0 .75rem; }
  .hero-badge { font-size: .72rem; }
  .hero-sub   { font-size: .88rem; }

  /* Main grid */
  .app-main { padding: 1rem .75rem 4rem; gap: 1rem; }

  /* Glass card */
  .glass-card { padding: 1rem; border-radius: var(--r-md); }

  /* Amount */
  .amount-input { font-size: 1.6rem; }

  /* Method grid — 2 cols on small phones */
  .method-grid { grid-template-columns: repeat(2, 1fr); gap: .5rem; }
  .method-tile  { padding: .85rem .65rem; }
  .method-icon  { font-size: 1.3rem; }
  .method-label { font-size: .78rem; }

  /* Receiver form */
  .field-row { grid-template-columns: 1fr; }

  /* Summary */
  .detail-row { flex-wrap: wrap; gap: .25rem; }
  .detail-key, .detail-val { font-size: .82rem; }

  /* Buttons */
  .btn-row { flex-direction: column; gap: .5rem; }
  .btn-row .btn-primary { order: 1; width: 100%; }
  .btn-row .btn-ghost { order: 2; width: 100%; }

  /* Result */
  .result-panel { padding: 1.75rem 1rem; }
  .result-actions { flex-direction: column; align-items: stretch; }
  .result-actions .btn-accent, .result-actions .btn-ghost { width: 100%; justify-content: center; }

  /* Onboarding */
  .onboarding-section { padding: 1.75rem .75rem; }
  .onboard-form { gap: .75rem; }

  /* Side panel stacks */
  .side-panels { gap: .75rem; }
  .widget { padding: 1rem; }

  /* Toast — full width on mobile */
  .toast-wrap { left: .75rem; right: .75rem; bottom: 1rem; align-items: stretch; }
  .toast { max-width: 100%; }
}

/* ── Very small phones (≤ 360px) ─────────────────────────────────────────── */
@media (max-width: 360px) {
  .hero-title { font-size: 1.75rem; }
  .site-header { height: 52px; }
  .logo-text   { display: none; }  /* just show icon on extreme small */
  .steps-row   { gap: 0; }
  .step-dot    { padding: .35rem; }
}

/* ── Tablet (641px – 900px) — refined two-column layout ──────────────────── */
@media (min-width: 641px) and (max-width: 900px) {
  .app-main { padding: 1.5rem 1.25rem 4rem; gap: 1.5rem; }
  .method-grid { grid-template-columns: repeat(3, 1fr); }
  .field-row { grid-template-columns: 1fr 1fr; }
}

/* ── Dashboard responsive overrides ──────────────────────────────────────── */
@media (max-width: 768px) {
  .stats-grid  { grid-template-columns: repeat(2, 1fr) !important; }
  .form-row    { grid-template-columns: 1fr !important; }
  .table-wrap  { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .table-wrap table { min-width: 540px; }
}
@media (max-width: 480px) {
  .stats-grid  { grid-template-columns: 1fr 1fr !important; gap: .65rem !important; }
  .stat-card   { padding: .85rem !important; }
  .stat-value  { font-size: 1.5rem !important; }
  .section-title { font-size: 1.1rem !important; }
  .card        { padding: 1rem !important; }
}

/* ── Light theme additions ────────────────────────────────────────────────── */
[data-theme="light"] #kycSection > div:first-child {
  background: rgba(0,150,255,.05);
  border-color: rgba(0,150,255,.18);
}
