/* ============================================================
   YehPay — base.css  (mobile-app design tokens & primitives)
   Mobile-first. On desktop, content is centered in a phone-width column.
   ============================================================ */

:root {
  /* === COLOR — ink (navy) === */
  --ink-900: #061a30;
  --ink-800: #0A2540;
  --ink-700: #1E3A5F;
  --ink-600: #3A547A;
  --ink-500: #6B7E9A;
  --ink-400: #94A3B8;
  --ink-300: #CBD5E1;
  --ink-200: #E2E8F0;
  --ink-100: #F1F5F9;
  --ink-50:  #F8FAFC;

  /* === COLOR — brand (sky) === */
  --brand-900: #0C4A6E;
  --brand-800: #075985;
  --brand-700: #0369A1;
  --brand-600: #0284C7;
  --brand-500: #0EA5E9;
  --brand-400: #38BDF8;
  --brand-300: #7DD3FC;
  --brand-200: #BAE6FD;
  --brand-100: #E0F2FE;
  --brand-50:  #F0F9FF;

  /* === COLOR — semantics === */
  --success-700: #047857;
  --success-600: #16A34A;
  --success-100: #DCFCE7;
  --success-50:  #ECFDF5;

  --warning-700: #B45309;
  --warning-600: #F59E0B;
  --warning-50:  #FFFBEB;

  --danger-700:  #B91C1C;
  --danger-600:  #DC2626;
  --danger-50:   #FEF2F2;

  /* === SURFACE === */
  --bg:        #FFFFFF;
  --surface-1: #FFFFFF;
  --surface-2: var(--ink-50);
  --surface-3: var(--ink-100);
  --border:    var(--ink-200);
  --border-strong: var(--ink-300);

  /* === TEXT === */
  --text-1: var(--ink-800);
  --text-2: var(--ink-600);
  --text-3: var(--ink-500);
  --text-4: var(--ink-400);

  /* === TYPE === */
  --font-display: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-body:    'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;

  /* === SPACE === */
  --s-1: 4px;  --s-2: 8px;  --s-3: 12px; --s-4: 16px; --s-5: 20px;
  --s-6: 24px; --s-7: 32px; --s-8: 40px; --s-9: 56px; --s-10: 72px;

  /* === RADIUS === */
  --r-sm:  8px;
  --r-md:  12px;
  --r-lg:  18px;
  --r-xl:  24px;
  --r-2xl: 32px;
  --r-3xl: 40px;
  --r-full: 999px;

  /* === SHADOW === */
  --shadow-xs: 0 1px 2px rgba(10, 37, 64, .05);
  --shadow-sm: 0 4px 12px -4px rgba(10, 37, 64, .08);
  --shadow-md: 0 12px 28px -10px rgba(10, 37, 64, .14);
  --shadow-lg: 0 28px 60px -24px rgba(10, 37, 64, .25);
  --shadow-brand: 0 14px 32px -10px rgba(2, 132, 199, .55);

  /* === MOTION === */
  --t-fast: 140ms;
  --t-base: 220ms;
  --ease:   cubic-bezier(.2, .8, .2, 1);

  /* === APP FRAME === */
  --app-width: 440px;
  --app-pad:   20px;        /* side gutter inside app */
  --app-bar-h: 56px;        /* top bar height */
  --bottom-cta-h: 92px;     /* sticky bottom CTA bar height */
}

/* ============================================================
   RESET
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  color: var(--text-1);
  background: var(--ink-50);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img, svg, picture, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
input, textarea, select { font: inherit; color: inherit; }
h1, h2, h3, h4, p, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }

:focus-visible {
  outline: 2px solid var(--brand-500);
  outline-offset: 3px;
  border-radius: 6px;
}

/* ============================================================
   APP FRAME  — center content in phone-width column on desktop
   ============================================================ */
.app {
  position: relative;
  width: 100%;
  max-width: var(--app-width);
  margin-inline: auto;
  background: #FFFFFF;
  min-height: 100vh;
  overflow: hidden;
}
@media (min-width: 600px) {
  body {
    background:
      radial-gradient(60% 50% at 50% 0%, rgba(56, 189, 248, .18), transparent 70%),
      radial-gradient(50% 40% at 80% 100%, rgba(2, 132, 199, .12), transparent 70%),
      var(--ink-100);
  }
  .app {
    margin-top: 24px;
    margin-bottom: 24px;
    border-radius: var(--r-3xl);
    box-shadow: var(--shadow-lg);
    min-height: auto;
  }
}

/* ============================================================
   TYPOGRAPHY (mobile-app scale)
   ============================================================ */
.display, h1, h2, h3, h4 {
  font-family: var(--font-display);
  letter-spacing: -.02em;
  color: var(--ink-800);
  font-weight: 700;
}
h1 { font-size: 30px; line-height: 1.12; font-weight: 800; }
h2 { font-size: 22px; line-height: 1.2;  font-weight: 800; }
h3 { font-size: 17px; line-height: 1.3;  font-weight: 700; }
h4 { font-size: 15px; line-height: 1.35; font-weight: 700; }

.eyebrow {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--brand-700);
}

.text-lead  { font-size: 16px; line-height: 1.55; color: var(--text-2); }
.text-sm    { font-size: 13px; }
.text-xs    { font-size: 12px; }
.text-muted { color: var(--text-2); }
.text-faint { color: var(--text-3); }
.tabular    { font-variant-numeric: tabular-nums; }

/* ============================================================
   BUTTONS  (mobile-friendly, 52px tall by default)
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 52px;
  padding: 0 22px;
  border-radius: var(--r-full);
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
  border: 1px solid transparent;
  background: transparent;
  color: inherit;
  white-space: nowrap;
  user-select: none;
  transition: background var(--t-fast) var(--ease),
              color var(--t-fast) var(--ease),
              transform var(--t-fast) var(--ease),
              box-shadow var(--t-base) var(--ease);
}
.btn:active { transform: scale(.97); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; pointer-events: none; }

.btn--primary {
  background: linear-gradient(180deg, var(--brand-500), var(--brand-600));
  color: #fff;
  box-shadow: var(--shadow-brand), inset 0 1px 0 rgba(255, 255, 255, .25);
}
.btn--primary:hover {
  background: linear-gradient(180deg, var(--brand-400), var(--brand-500));
}

.btn--white {
  background: #fff;
  color: var(--ink-800);
  box-shadow: 0 8px 24px -10px rgba(10, 37, 64, .25);
}
.btn--white:hover { background: var(--brand-50); }

.btn--ghost {
  background: transparent;
  color: var(--text-1);
}
.btn--ghost:hover { background: var(--surface-3); }

.btn--ghost-light {
  background: rgba(255, 255, 255, .12);
  color: #fff;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.btn--ghost-light:hover { background: rgba(255, 255, 255, .18); }

.btn--outline {
  background: transparent;
  color: var(--ink-800);
  border-color: var(--border-strong);
}
.btn--outline:hover { background: var(--surface-2); }

/* Sizes */
.btn--sm { height: 40px; padding: 0 16px; font-size: 13px; font-weight: 600; }
.btn--lg { height: 56px; padding: 0 28px; font-size: 16px; }
.btn--block { width: 100%; }

/* ============================================================
   UTILITIES (used by layout/landing)
   ============================================================ */
.flex { display: flex; }
.flex-1 { flex: 1; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-2 { gap: var(--s-2); }
.gap-3 { gap: var(--s-3); }
.gap-4 { gap: var(--s-4); }

.text-center { text-align: center; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.fw-800 { font-weight: 800; }

.mt-2 { margin-top: var(--s-2); }
.mt-3 { margin-top: var(--s-3); }
.mt-4 { margin-top: var(--s-4); }
.mt-6 { margin-top: var(--s-6); }
.mb-2 { margin-bottom: var(--s-2); }
.mb-3 { margin-bottom: var(--s-3); }
.mb-4 { margin-bottom: var(--s-4); }

.icon { flex-shrink: 0; }

/* ============================================================
   FLASH messages (universal — work in any page context)
   ============================================================ */
.flash {
  margin: 0 16px 12px;
  padding: 12px 14px;
  border-radius: 14px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13.5px;
  line-height: 1.5;
  box-shadow: 0 4px 14px -6px rgba(15, 23, 42, .08);
  border: 1px solid transparent;
}
.flash svg { flex-shrink: 0; margin-top: 1px; }
.flash a   { color: inherit; text-decoration: underline; font-weight: 600; }
.flash code { background: rgba(0,0,0,.08); padding: 1px 6px; border-radius: 4px; font-family: ui-monospace, monospace; font-size: 12px; }

.flash--success { background: var(--success-50); color: var(--success-700); border-color: #BBF7D0; }
.flash--info    { background: var(--brand-50);   color: var(--brand-700);   border-color: var(--brand-100); }
.flash--warning { background: var(--warning-50); color: var(--warning-700); border-color: #FDE68A; }
.flash--danger  { background: var(--danger-50);  color: var(--danger-700);  border-color: #FECACA; }

/* Auth pages own padding container — zero side margins inside it */
.auth-page .flash { margin: 0 0 4px; }
.pb-page   .flash { margin: 0 16px 16px; }

/* ============================================================
   FIELD-CHECK (universal checkbox styled control)
   Used by auth, kyc, profile, settings — promoted from auth.css
   so any page can use it without pulling auth.css.
   ============================================================ */
.field-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 4px;
  cursor: pointer;
}
.field-check input { display: none; }
.field-check__box {
  width: 20px; height: 20px;
  border: 1.5px solid var(--ink-300);
  border-radius: 6px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  background: #fff;
  color: transparent;
  transition: background .15s ease, border-color .15s ease;
  margin-top: 1px;
}
.field-check input:checked + .field-check__box {
  background: var(--brand-600);
  border-color: var(--brand-600);
  color: #fff;
}
.field-check__label {
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.45;
}
.field-check__label a {
  color: var(--brand-700);
  font-weight: 600;
}
.field-check__label a:hover { color: var(--brand-800); }

/* =====================================================
   BOTTOM TAB BAR  (5 items, center FAB) — shared
   ===================================================== */
.tabbar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 40;
  width: 100%;
  max-width: var(--app-width);
  margin-inline: auto;
  background: rgba(255, 255, 255, .9);
  -webkit-backdrop-filter: saturate(180%) blur(24px);
  backdrop-filter: saturate(180%) blur(24px);
  border-top: 1px solid rgba(15, 23, 42, .05);
  border-radius: 22px 22px 0 0;
  box-shadow: 0 -8px 28px -14px rgba(15, 23, 42, .22);
  padding: 7px 10px calc(7px + env(safe-area-inset-bottom));
}
.tabbar__inner {
  display: grid;
  grid-template-columns: 1fr 1fr 84px 1fr 1fr;
  align-items: center;
  height: 58px;
}
.tab {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 7px 0 4px;
  color: var(--text-3);
  font-size: 10.5px;
  font-weight: 600;
  text-decoration: none;
  transition: color var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}
.tab:active { transform: scale(.92); }
.tab svg { width: 23px; height: 23px; transition: transform var(--t-fast) var(--ease); }
.tab.is-active { color: var(--brand-700); font-weight: 700; }
.tab.is-active svg { transform: translateY(-1px); }
.tab.is-active::before {
  content: '';
  position: absolute;
  top: -7px; left: 50%; transform: translateX(-50%);
  width: 18px; height: 3px; border-radius: 3px;
  background: linear-gradient(90deg, var(--brand-500), var(--brand-700));
}
.tab--fab { position: relative; margin-top: -28px; }
.tab--fab .tab-fab__btn {
  width: 60px; height: 60px;
  border-radius: 50%;
  background: linear-gradient(150deg, #38BDF8 0%, var(--brand-500) 45%, var(--brand-700) 100%);
  color: #fff;
  display: grid; place-items: center;
  border: 4px solid #fff;
  box-shadow: 0 14px 28px -8px rgba(2, 132, 199, .6), 0 4px 10px -2px rgba(2, 132, 199, .35), inset 0 1px 0 rgba(255, 255, 255, .35);
  transition: transform var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
.tab--fab:active .tab-fab__btn { transform: scale(.93); }
.tab--fab .tab-fab__lbl { display: block; text-align: center; font-size: 10.5px; font-weight: 700; color: var(--brand-700); margin-top: 5px; }
