/* Avenix Bank — UXPilot Global Design System (MVP v1) */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;600&family=Playfair+Display:wght@600;700&display=swap');
@import url('pwa-standalone-dock.css');

:root {
  --brand-900: #0d2e6e;
  --brand-700: #1a4baf;
  --brand-500: #2563eb;
  --accent-600: #009e78;
  --accent-500: #00c896;
  --accent-100: #e6fbf5;
  --danger-600: #c53030;
  --danger-500: #e53e3e;
  --danger-100: #fff5f5;
  --warn-600: #b45309;
  --warn-500: #d97706;
  --warn-100: #fffbeb;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --border: #e2e8f0;
  --surface: #f8fafc;
  --white: #ffffff;
  --nav-navy: #0a1f4e;
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-display: 'Playfair Display', Georgia, serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-pill: 999px;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
  --space-4: 16px;
  --space-6: 24px;
  --max-mobile: 440px;
  /* Floating bottom nav (fintech pill) */
  --sp-nav-pill-h: 64px;
  --sp-nav-float-gap: 12px;
  --sp-nav-side-inset: 16px;
  --sp-bottom-nav-h: var(--sp-nav-pill-h);
  --sp-nav-dock-space: calc(var(--sp-nav-pill-h) + var(--sp-nav-float-gap) * 2);
  --sp-dash-cta-h: 52px;
  --sp-dash-cta-pad: 12px;
  --sp-dash-dock-h: calc(
    var(--sp-nav-dock-space) + var(--sp-dash-cta-h) + var(--sp-dash-cta-pad) +
      env(safe-area-inset-bottom, 0px)
  );
  /* Safari/Chrome in-browser — visualViewport height (set by sp-icons.js) */
  --sp-browser-bottom-offset: 0px;
  --sp-vv-height: 100dvh;
  --sp-vv-offset-top: 0px;
  /* Measured bottom dock height (set by sp-icons.js syncDockHeight) */
  --sp-safe-bottom: env(safe-area-inset-bottom, 0px);
  --sp-dock-height: 88px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.45;
  color: var(--text-primary);
  background: var(--surface);
  min-height: 100dvh;
}

a {
  color: var(--brand-700);
  text-decoration: none;
  font-weight: 600;
}

a:hover {
  text-decoration: none;
}

a:focus-visible {
  outline: 2px solid rgba(37, 99, 235, 0.45);
  outline-offset: 2px;
  border-radius: 2px;
}

.mono {
  font-family: var(--font-mono);
}

/* --- Mobile shell (centered column on desktop) --- */
.sp-app {
  max-width: var(--max-mobile);
  margin: 0 auto;
  min-height: 100dvh;
  background: var(--white);
  box-shadow: var(--shadow-md);
  position: relative;
}

.sp-app--surface {
  background: var(--surface);
}

/* --- Splash gradient --- */
.sp-splash {
  min-height: 100dvh;
  background: linear-gradient(160deg, var(--brand-900) 0%, var(--nav-navy) 100%);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--space-6) var(--space-4) calc(40px + env(safe-area-inset-bottom));
}

.sp-splash__decor-tr {
  position: absolute;
  top: -80px;
  right: -80px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: var(--accent-500);
  opacity: 0.12;
  pointer-events: none;
}

.sp-splash__decor-bl {
  position: absolute;
  bottom: -40px;
  left: -60px;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: #fff;
  opacity: 0.04;
  pointer-events: none;
}

.sp-logo-lg {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  background: var(--accent-500);
  color: var(--white);
  font-size: 28px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 48px;
  box-shadow: 0 8px 24px rgba(0, 200, 150, 0.3);
}

.sp-splash h1 {
  font-family: var(--font-display);
  color: var(--white);
  font-size: 28px;
  font-weight: 700;
  margin: 16px 0 0;
  letter-spacing: -0.01em;
}

.sp-splash__eyebrow {
  margin: 20px 0 0;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.65);
}

.sp-splash__tag {
  color: rgba(255, 255, 255, 0.55);
  font-size: 13px;
  text-align: center;
  max-width: 280px;
  margin: 6px 0 0;
  line-height: 1.5;
}

.sp-splash__actions {
  width: 100%;
  max-width: 320px;
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
  z-index: 5;
}

/* App splash (index.html) — stable taps, no redirect flash */
body.sp-splash-body {
  margin: 0;
  overflow: hidden;
}

body.sp-splash-body .sp-splash-app {
  min-height: 100dvh;
  min-height: -webkit-fill-available;
}

body.sp-splash-body .sp-splash-app.sp-page-enter {
  animation: none;
}

.sp-splash__content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 320px;
  flex: 1;
  min-height: 0;
}

.sp-splash__actions .btn {
  position: relative;
  z-index: 6;
  pointer-events: auto;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  text-decoration: none;
}

.sp-splash__actions a.btn {
  cursor: pointer;
}

.sp-footer-links {
  position: relative;
  z-index: 4;
}

.sp-footer-links a {
  pointer-events: auto;
  touch-action: manipulation;
}

.sp-footer-links {
  margin-top: 16px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.45);
  text-align: center;
}

.sp-footer-links a {
  color: rgba(255, 255, 255, 0.75);
  font-weight: 500;
}

/* --- Headers --- */
.sp-header {
  background: linear-gradient(135deg, var(--brand-900), var(--brand-700));
  color: var(--white);
  padding: calc(12px + env(safe-area-inset-top)) var(--space-4) 18px;
}

.sp-header--solid {
  background: var(--brand-900);
}

.sp-header__row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sp-header__back {
  color: var(--white);
  font-size: 22px;
  line-height: 1;
  padding: 4px;
  opacity: 0.95;
}

.sp-header__title {
  flex: 1;
}

.sp-header__title h1 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
}

.sp-header__title p {
  margin: 4px 0 0;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.55);
}

/* --- Forms --- */
.sp-screen-pad {
  padding: var(--space-4);
}

.sp-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.sp-input {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s ease;
}

.sp-input:focus {
  border-color: var(--brand-700);
  border-width: 2px;
  padding: 0 11px;
}

.sp-input--error {
  border-color: var(--danger-500);
}

.sp-field {
  margin-bottom: 14px;
}

.sp-row2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

/* PIN boxes */
.sp-pin-row {
  display: flex;
  gap: 8px;
  justify-content: flex-start;
}

.sp-pin-box {
  width: 50px;
  height: 52px;
  text-align: center;
  font-size: 20px;
  font-weight: 700;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
}

.sp-pin-box:focus {
  outline: none;
  border-color: var(--brand-700);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 52px;
  padding: 0 18px;
  border: none;
  border-radius: 11px;
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.15s ease, transform 0.1s ease;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn--primary {
  background: var(--brand-900);
  color: var(--white);
}

.btn--accent {
  background: var(--accent-500);
  color: var(--brand-900);
}

.btn--ghost {
  background: transparent;
  border: 1.5px solid var(--brand-900);
  color: var(--brand-900);
}

.btn--outline-white {
  background: transparent;
  border: 1.5px solid var(--white);
  color: var(--white);
}

.btn--danger-outline {
  background: transparent;
  border: 1.5px solid var(--danger-500);
  color: var(--danger-500);
}

.mt-8 {
  margin-top: 8px;
}
.mt-16 {
  margin-top: 16px;
}
.mt-24 {
  margin-top: 24px;
}
.mb-0 {
  margin-bottom: 0;
}

.text-center {
  text-align: center;
}

.text-muted {
  color: var(--text-muted);
  font-size: 13px;
}

.text-small {
  font-size: 12px;
}

/* Dashboard hero */
.sp-balance-wrap {
  margin-top: 18px;
  padding: 16px;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.sp-balance-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.55);
}

.sp-balance-amt {
  font-size: 30px;
  font-weight: 700;
  color: var(--white);
  margin-top: 4px;
}

.sp-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.1);
  font-family: var(--font-mono);
  font-size: 11px;
  color: rgba(255, 255, 255, 0.85);
  max-width: 100%;
  flex-wrap: wrap;
}

.sp-chip .mono {
  letter-spacing: 0.02em;
}

/* Quick actions */
.sp-quick-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  padding: var(--space-4);
  border-bottom: 1px solid var(--border);
  background: var(--white);
}

.sp-quick-item {
  text-align: center;
  text-decoration: none;
  color: var(--text-primary);
}

.sp-quick-item:active {
  opacity: 0.85;
}

.sp-quick-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 6px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
}

.sp-quick-icon--blue {
  background: #ebf2ff;
  color: var(--brand-700);
}
.sp-quick-icon--green {
  background: var(--accent-100);
  color: var(--accent-600);
}
.sp-quick-icon--red {
  background: var(--danger-100);
  color: var(--danger-500);
}
.sp-quick-icon--amber {
  background: var(--warn-100);
  color: var(--warn-600);
}
.sp-quick-icon--violet {
  background: #f3e8ff;
  color: #7c3aed;
}

.sp-icon {
  display: block;
  flex-shrink: 0;
}

.sp-chip .sp-icon {
  display: inline-block;
  vertical-align: -4px;
  margin-right: 4px;
}

.sp-quick-item span {
  font-size: 11px;
  color: var(--text-secondary);
}

/* Tx list */
.sp-section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px var(--space-4);
}

.sp-section-head h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
}

.sp-txn {
  display: flex;
  gap: 12px;
  padding: 14px var(--space-4);
  border-bottom: 1px solid var(--surface);
  align-items: center;
}

.sp-txn__avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--white);
  flex-shrink: 0;
}

.sp-txn__meta {
  flex: 1;
  min-width: 0;
}

.sp-txn__name {
  font-size: 13px;
  font-weight: 700;
}

.sp-txn__date {
  font-size: 11px;
  color: var(--text-muted);
}

.sp-txn__amt {
  font-size: 14px;
  font-weight: 700;
  text-align: right;
}

.sp-txn__amt--sent {
  color: var(--danger-500);
}

.sp-txn__amt--recv {
  color: var(--accent-600);
}

/* Floating fintech bottom nav pill (positioned inside .sp-app-shell__chrome dock) */
.sp-bottom-nav {
  position: relative;
  left: auto;
  right: auto;
  bottom: auto;
  transform: none;
  -webkit-transform: none;
  width: 100%;
  max-width: 100%;
  min-height: var(--sp-nav-pill-h);
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
  padding: 6px 8px;
  box-sizing: border-box;
  z-index: 220;
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.72);
  box-shadow:
    0 8px 32px rgba(15, 23, 42, 0.14),
    0 2px 8px rgba(15, 23, 42, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  -webkit-backdrop-filter: blur(22px) saturate(180%);
  backdrop-filter: blur(22px) saturate(180%);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .sp-bottom-nav {
    background: rgba(255, 255, 255, 0.96);
  }
}

.sp-bottom-nav a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-height: 52px;
  padding: 6px 4px;
  border-radius: 20px;
  text-align: center;
  font-size: 10px;
  line-height: 1.1;
  letter-spacing: 0.02em;
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 600;
  transition:
    color 0.28s cubic-bezier(0.4, 0, 0.2, 1),
    background 0.28s cubic-bezier(0.4, 0, 0.2, 1),
    transform 0.2s cubic-bezier(0.4, 0, 0.2, 1),
    box-shadow 0.28s ease;
}

.sp-bottom-nav a.active {
  color: var(--brand-900);
  background: rgba(13, 46, 110, 0.1);
  box-shadow: inset 0 0 0 1px rgba(13, 46, 110, 0.07);
}

.sp-bottom-nav a:not(.active):active {
  transform: scale(0.96);
}

.sp-nav-ico {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  color: inherit;
  transition:
    transform 0.28s cubic-bezier(0.34, 1.2, 0.64, 1),
    color 0.28s ease,
    opacity 0.28s ease;
}

.sp-bottom-nav a:not(.active) .sp-nav-ico {
  opacity: 0.72;
}

.sp-bottom-nav a.active .sp-nav-ico {
  transform: scale(1.1);
  opacity: 1;
}

.sp-nav-label {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: opacity 0.28s ease;
}

.sp-bottom-nav a:not(.active) .sp-nav-label {
  opacity: 0.88;
}

.sp-profile-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand-900), var(--brand-700));
  color: #fff;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 0.02em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 20px rgba(13, 46, 110, 0.28);
  border: 3px solid #fff;
  outline: 1px solid var(--border);
}

.sp-list-row__icon .sp-icon,
.sp-list-row__icon svg {
  display: block;
  flex-shrink: 0;
}

.sp-list-menu {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.sp-list-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 500;
  transition: background 0.15s ease;
  box-sizing: border-box;
}

.sp-list-menu > .sp-list-row,
.sp-list-menu > a.sp-list-row {
  font-weight: 500;
  color: var(--text-primary);
}

.sp-list-row--btn {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--white);
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.sp-list-row--danger .sp-list-row__label {
  color: var(--danger-600);
  font-weight: 600;
}

.sp-list-menu > .sp-list-row:last-child,
.sp-list-menu > a.sp-list-row:last-of-type {
  border-bottom: 0;
}

.sp-list-row:active {
  background: var(--surface);
}

.sp-list-row__icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sp-list-row__icon--blue {
  background: #ebf2ff;
  color: var(--brand-700);
}
.sp-list-row__icon--green {
  background: var(--accent-100);
  color: var(--accent-600);
}
.sp-list-row__icon--amber {
  background: var(--warn-100);
  color: var(--warn-600);
}
.sp-list-row__icon--red {
  background: var(--danger-100);
  color: var(--danger-500);
}
.sp-list-row__icon--violet {
  background: #f3e8ff;
  color: #7c3aed;
}
.sp-list-row__icon--slate {
  background: var(--surface);
  color: var(--text-secondary);
}

.sp-list-row__label {
  flex: 1;
  min-width: 0;
}

.sp-list-row__chev {
  color: var(--text-muted);
  display: flex;
}

.sp-body-pad-bottom {
  padding-bottom: calc(
    var(--sp-nav-dock-space) + constant(safe-area-inset-bottom) +
      env(safe-area-inset-bottom, 0px) + var(--sp-browser-bottom-offset, 0px)
  );
}

/* Auth screens (login/register) — no bottom nav chrome */
body.sp-auth-body {
  margin: 0;
  min-height: 100dvh;
  background: var(--white);
  overflow-x: hidden;
}

body.sp-auth-body .sp-auth-app {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  max-width: var(--max-mobile);
  margin: 0 auto;
  overflow: hidden;
}

body.sp-auth-body .sp-logo-lg--float {
  animation: none;
}

body.sp-auth-body .sp-auth-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding-bottom: calc(28px + env(safe-area-inset-bottom, 0));
}

body.sp-auth-body .sp-auth-actions {
  margin-top: 8px;
}

/* --- App shell (all in-app screens + dashboard) --- */
body.sp-app-body {
  margin: 0;
  overflow: hidden;
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  height: 100dvh;
}

.sp-app-shell {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: var(--max-mobile);
  height: 100%;
  height: 100dvh;
  height: -webkit-fill-available;
  max-height: 100dvh;
  margin: 0 auto;
  overflow: hidden;
  background: var(--white);
  box-sizing: border-box;
}

.sp-app-shell.sp-app--surface {
  background: var(--surface);
}

.sp-app-shell__main {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.sp-app-shell__chrome {
  flex: 0 0 auto;
  flex-shrink: 0;
  width: 100%;
  background: var(--white);
  border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom, 0);
  z-index: 100;
  box-sizing: border-box;
}

/* Bottom dock + scroll padding — see sp-app-dock.css (loaded after main.css) */

/* Dashboard header */
.sp-dash.sp-app-shell {
  background: var(--white);
}

.sp-dash__header {
  flex: 0 0 auto;
  flex-shrink: 0;
}

.sp-dash-greet {
  padding-top: 2px;
}

.sp-dash-greet__identity {
  min-width: 0;
}

.sp-dash-greet__line {
  margin: 0;
  font-size: 12px;
  line-height: 16px;
  color: rgba(255, 255, 255, 0.65);
}

.sp-dash-greet__name {
  margin: 4px 0 0;
  font-size: 17px;
  font-weight: 700;
  line-height: 22px;
  color: #fff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sp-dash-balance {
  margin-top: 16px;
}

.sp-dash-balance__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.sp-dash-balance__head .sp-balance-label {
  margin: 0;
  flex: 1 1 auto;
  min-width: 0;
}

.sp-dash-balance__actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.sp-dash-signout {
  height: 32px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  white-space: nowrap;
  touch-action: manipulation;
}

.sp-header-refresh--icon {
  width: 32px;
  height: 32px;
  min-width: 32px;
  padding: 0;
  font-size: 16px;
  border-radius: 10px;
}

.sp-dash .sp-balance-amt {
  font-size: 30px;
  font-weight: 700;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sp-dash .sp-chip {
  margin-top: 10px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sp-dash .sp-balance-wrap--reveal {
  animation: none;
}

.sp-dash .sp-loading-pulse {
  animation: none;
  opacity: 0.7;
}

.sp-dash-kyc {
  margin: 12px 16px 0;
  text-align: left;
}

.sp-dash-kyc__text {
  margin: 8px 0 12px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--text-muted);
}

.sp-dash-kyc__text a {
  color: var(--brand-700);
  font-weight: 600;
}

.sp-section-head__link {
  font-size: 13px;
  font-weight: 600;
}

.sp-dash__chrome .sp-dash-cta {
  position: relative;
  display: flex;
  width: 100%;
  max-width: 100%;
  margin: 0;
  min-height: var(--sp-dash-cta-h);
  flex-shrink: 0;
  text-decoration: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  box-sizing: border-box;
  border-radius: 14px;
  box-shadow: 0 6px 20px rgba(13, 46, 110, 0.22);
}

.sp-dash .sp-empty {
  padding-bottom: 16px;
}

/* Alerts */
.sp-banner-error {
  background: var(--danger-100);
  border-left: 4px solid var(--danger-500);
  padding: 10px 12px;
  font-size: 13px;
  color: var(--danger-600);
  margin-bottom: 12px;
  border-radius: var(--radius-sm);
}

.sp-banner-success {
  background: var(--accent-100);
  border-left: 4px solid var(--accent-500);
  padding: 10px 12px;
  font-size: 13px;
  color: var(--text-primary);
  margin-bottom: 12px;
}

/* Recipient verified card */
.sp-verify-card {
  background: #f5f8ff;
  border: 1px solid rgba(26, 75, 175, 0.35);
  border-radius: var(--radius-lg);
  padding: 14px;
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 16px;
}

.sp-verify-card__badge {
  margin-left: auto;
  font-size: 10px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: var(--radius-pill);
  background: var(--accent-100);
  color: var(--accent-600);
}

/* Warning inline */
.sp-warn-box {
  background: var(--warn-100);
  border-left: 4px solid var(--warn-500);
  padding: 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--warn-600);
  margin-top: 16px;
}

.hidden {
  display: none !important;
}

/* Success screen */
.sp-success-ring {
  width: 80px;
  height: 80px;
  margin: 24px auto 0;
  border-radius: 50%;
  background: var(--accent-100);
  border: 4px solid var(--accent-500);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  color: var(--accent-600);
}

@media (min-width: 768px) {
  .sp-app {
    margin-top: 12px;
    margin-bottom: 12px;
    min-height: calc(100dvh - 24px);
    border-radius: var(--radius-xl);
    overflow: hidden;
  }

  .sp-bottom-nav {
    border-radius: 28px;
  }
}

.filter-chip.active {
  background: var(--brand-900);
  color: var(--white);
  border-color: var(--brand-900);
}

/* Dashboard / async content */
.sp-loading-pulse {
  opacity: 0.55;
  animation: sp-loading-pulse 1.05s ease-in-out infinite;
}
@keyframes sp-loading-pulse {
  50% {
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* --- Page enter (shell) --- */
@keyframes sp-page-enter {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.sp-page-enter {
  animation: sp-page-enter 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* --- Toasts --- */
.sp-toast-host {
  position: fixed;
  left: 50%;
  transform: translate3d(-50%, 0, 0);
  bottom: calc(
    var(--sp-nav-dock-space) + constant(safe-area-inset-bottom) +
      env(safe-area-inset-bottom, 0px) + var(--sp-browser-bottom-offset, 0px) + 8px
  );
  width: calc(100% - 32px);
  max-width: calc(var(--max-mobile) - 32px);
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.sp-toast {
  pointer-events: none;
  align-self: center;
  max-width: 100%;
  padding: 12px 16px;
  border-radius: var(--radius-lg);
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 8px 28px rgba(15, 23, 42, 0.18);
  opacity: 0;
  transform: translateY(12px) scale(0.96);
  transition:
    opacity 0.28s ease,
    transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}

.sp-toast--show {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.sp-toast--success {
  background: var(--brand-900);
  color: var(--white);
}

.sp-toast--info {
  background: var(--text-primary);
  color: var(--white);
}

.sp-toast--error {
  background: var(--danger-500);
  color: var(--white);
}

/* --- Transfer stepper --- */
.sp-xfer-stepper {
  padding: 10px var(--space-4) 14px;
  background: var(--brand-900);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sp-xfer-stepper__track {
  height: 4px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.15);
  overflow: hidden;
}

.sp-xfer-stepper__fill {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--accent-500), #5eead4);
  transition: width 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.sp-xfer-stepper__labels {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
}

.sp-xfer-stepper__labels span.sp-xfer-stepper--on {
  color: rgba(255, 255, 255, 0.95);
}

/* --- UK pay / transfer --- */
.sp-pay-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.sp-pay-tab {
  flex: 1;
  min-height: 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--white);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition:
    background 0.15s ease,
    color 0.15s ease,
    border-color 0.15s ease;
}

.sp-pay-tab.active {
  background: var(--brand-900);
  border-color: var(--brand-900);
  color: #fff;
}

.sp-form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 10px;
}

.sp-input-wrap {
  position: relative;
}

.sp-input-spin {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 12px;
  color: var(--text-muted);
}

.sp-amount-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sp-amount-row__sym {
  font-size: 22px;
  color: var(--text-muted);
  font-weight: 600;
}

.sp-amount-row__input {
  font-size: 24px !important;
  font-weight: 700 !important;
  color: var(--brand-900) !important;
}

.sp-check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  font-size: 14px;
  cursor: pointer;
}

.sp-cop-badge {
  margin-top: 6px;
  min-height: 16px;
}

.sp-payee-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.sp-payee-chip {
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--white);
  padding: 8px 14px;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  color: var(--brand-700);
  cursor: pointer;
}

.sp-payee-chip:active {
  background: var(--surface);
}

.sp-review-amount {
  font-size: 40px;
  font-weight: 700;
  color: var(--brand-900);
  margin: 8px 0 20px;
}

.sp-review-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  text-align: left;
  margin-bottom: 16px;
}

.sp-review-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px dashed var(--border);
  font-size: 13px;
}

.sp-review-row--last {
  border-bottom: 0;
}

.sp-review-row strong {
  text-align: right;
  max-width: 58%;
}

.sp-pin-lock {
  color: var(--brand-700);
  margin-bottom: 8px;
}

.sp-pin-pad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  max-width: 280px;
  margin: 0 auto;
}

.sp-pin-pad .pin-key,
.sp-pin-pad .btn {
  min-height: 56px;
  font-size: 20px;
}

#pinDots {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin-bottom: 24px;
}

.sp-card-form {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 20px;
}

.sp-card-form__title {
  margin: 0 0 14px;
  font-size: 15px;
  font-weight: 700;
}

.sp-section-title {
  margin: 0 0 12px;
  font-size: 15px;
  font-weight: 700;
}

.sp-sched-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 10px;
}

.sp-sched-card__top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.sp-sched-card__meta {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
}

/* --- Transfer step panels --- */
.xfer-step:not(.hidden) {
  animation: xfer-step-in 0.38s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes xfer-step-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --- Balance card pulse on load --- */
@keyframes sp-balance-reveal {
  from {
    opacity: 0.65;
  }
  to {
    opacity: 1;
  }
}

.sp-balance-wrap--reveal {
  animation: sp-balance-reveal 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* --- Quick actions hover (desktop) --- */
@media (hover: hover) {
  .sp-quick-item:hover .sp-quick-icon {
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
  }
}

.sp-quick-icon {
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

/* --- Transaction rows --- */
.sp-txn {
  transition:
    background 0.18s ease,
    transform 0.18s ease;
}

@media (hover: hover) {
  .sp-txn:hover {
    background: #f8fafc;
  }
}

.sp-txn:active {
  transform: scale(0.99);
}

@keyframes sp-fade-in-up {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.sp-txn--enter {
  animation: sp-fade-in-up 0.38s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* --- Empty states --- */
.sp-empty {
  text-align: center;
  padding: 36px var(--space-4) 28px;
}

.sp-empty__icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 16px;
  border-radius: 22px;
  background: linear-gradient(145deg, #ebf2ff, #e6fbf5);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--brand-700);
  box-shadow: var(--shadow-sm);
}

.sp-empty__title {
  margin: 0 0 6px;
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}

.sp-empty__sub {
  margin: 0;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
  max-width: 260px;
  margin-left: auto;
  margin-right: auto;
}

.sp-empty__cta {
  margin-top: 18px;
}

/* Safari in-browser: fit shell to visible viewport (dock rules in sp-app-dock.css) */
html.sp-browser-mode body.sp-app-body {
  position: fixed;
  top: var(--sp-vv-offset-top, 0px);
  left: 0;
  right: 0;
  bottom: auto;
  width: 100%;
  height: var(--sp-vv-height, 100dvh);
  max-height: var(--sp-vv-height, 100dvh);
  overflow: hidden;
}

html.sp-browser-mode .sp-app-shell {
  height: 100%;
  max-height: 100%;
  min-height: 0;
  overflow: hidden;
}

html.sp-browser-mode .sp-has-bottom-nav .sp-app-shell__chrome {
  bottom: var(--sp-browser-bottom-offset, 0px);
}

/* iPhone SE — slightly tighter pill */
@media (max-width: 375px) {
  .sp-bottom-nav {
    --sp-nav-side-inset: 12px;
    border-radius: 24px;
    padding: 5px 6px;
    gap: 2px;
  }

  .sp-bottom-nav a {
    min-height: 48px;
    font-size: 9px;
  }

  .sp-nav-ico {
    width: 26px;
    height: 26px;
  }
}

/* --- Buttons --- */
.btn:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.45);
  outline-offset: 2px;
}

.btn:not(:disabled):active {
  transform: scale(0.98);
}

/* --- Recipient card pop-in --- */
@keyframes sp-verify-pop {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.sp-verify-card--show {
  animation: sp-verify-pop 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* --- PIN dots (class-based) --- */
.pin-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid var(--border);
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    transform 0.15s ease;
}

.pin-dot--filled {
  background: var(--brand-900);
  border-color: var(--brand-900);
  transform: scale(1.08);
}

/* --- History bottom sheet --- */
.sp-sheet {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.48);
  z-index: 100;
  display: flex;
  justify-content: flex-end;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.sp-sheet.sp-sheet--open {
  opacity: 1;
  pointer-events: auto;
}

.sp-sheet__panel {
  width: 100%;
  max-width: 400px;
  background: var(--white);
  min-height: 100%;
  overflow: auto;
  padding: var(--space-4);
  box-shadow: -12px 0 40px rgba(15, 23, 42, 0.12);
  transform: translateX(100%);
  transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}

.sp-sheet.sp-sheet--open .sp-sheet__panel {
  transform: translateX(0);
}

.sp-sheet__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.sp-sheet__title {
  font-size: 17px;
  font-weight: 700;
  margin: 0;
}

.sp-kv {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 4px 0;
  margin-bottom: 12px;
}

.sp-kv__row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  font-size: 13px;
  border-bottom: 1px dashed var(--border);
}

.sp-kv__row:last-child {
  border-bottom: none;
}

.sp-kv__k {
  color: var(--text-muted);
  flex-shrink: 0;
}

.sp-kv__v {
  font-weight: 600;
  text-align: right;
  word-break: break-word;
}

.sp-status-pill {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.sp-status-pill--completed {
  background: rgba(16, 185, 129, 0.15);
  color: #047857;
}

.sp-status-pill--pending {
  background: rgba(245, 158, 11, 0.18);
  color: #b45309;
}

.sp-status-pill--reversed,
.sp-status-pill--flagged {
  background: rgba(239, 68, 68, 0.12);
  color: #b91c1c;
}

/* --- Splash logo idle --- */
@keyframes sp-logo-float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-4px);
  }
}

.sp-logo-lg--float {
  animation: sp-logo-float 3.5s ease-in-out infinite;
}

/* --- Header refresh (dashboard) --- */
.sp-header-refresh {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.1);
  color: var(--white);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    background 0.15s ease,
    transform 0.2s ease;
}

.sp-header-refresh:hover {
  background: rgba(255, 255, 255, 0.18);
}

.sp-header-refresh:active {
  transform: scale(0.94);
}

.sp-header-refresh.sp-spin {
  animation: sp-spin 0.7s linear infinite;
}

@keyframes sp-spin {
  to {
    transform: rotate(360deg);
  }
}
