/* ============================================================================
   SendMe.me — Design System (app.css)
   The universal payment profile.
   Tokens · Base · Typography · Components — shared across every page.
   ========================================================================== */

/* ----------------------------------------------------------------------------
   1. Design Tokens
   -------------------------------------------------------------------------- */
:root {
  /* Brand */
  --brand-500: #7c5cff;        /* signature violet */
  --brand-600: #6a47f5;
  --brand-400: #9a82ff;
  --brand-300: #bcacff;
  --money-500: #22e0a1;        /* "send / success" green */
  --money-600: #12c98c;
  --sky-500:   #38bdf8;
  --grad-brand: linear-gradient(135deg, #7c5cff 0%, #5b7cff 45%, #22d3ee 100%);
  --grad-money: linear-gradient(135deg, #7c5cff 0%, #22e0a1 100%);
  --grad-sunset: linear-gradient(135deg, #ff7a59 0%, #ff5c7c 50%, #b86bff 100%);

  /* Neutrals — cool ink scale */
  --ink-950: #06070d;
  --ink-900: #0a0b12;
  --ink-850: #0e1019;
  --ink-800: #141622;
  --ink-700: #1c1f2e;
  --ink-600: #262a3d;
  --ink-500: #353a52;
  --ink-400: #565d7e;
  --ink-300: #8b91ad;
  --ink-200: #b9bed3;
  --ink-100: #e3e6f0;
  --ink-50:  #f4f5fa;
  --white:   #ffffff;

  /* Semantic — app (dark) chrome */
  --bg:           var(--ink-950);
  --bg-elevated:  var(--ink-850);
  --surface:      rgba(255,255,255,0.025);
  --surface-2:    rgba(255,255,255,0.045);
  --surface-3:    rgba(255,255,255,0.07);
  --border:       rgba(255,255,255,0.08);
  --border-strong:rgba(255,255,255,0.14);
  --text:         #f3f4fb;
  --text-muted:   var(--ink-300);
  --text-dim:     var(--ink-400);
  --accent:       var(--brand-500);
  --accent-text:  #ffffff;
  --danger:       #ff5c6c;
  --warning:      #ffb454;
  --success:      var(--money-500);

  /* Radius */
  --r-xs: 8px;
  --r-sm: 11px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 28px;
  --r-2xl: 36px;
  --r-full: 999px;

  /* Spacing scale (4pt) */
  --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: 48px; --s-10: 64px;
  --s-11: 80px; --s-12: 96px; --s-13: 128px;

  /* Typography */
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-display: "Plus Jakarta Sans", "Inter", -apple-system, system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;

  --t-xs:   0.78rem;
  --t-sm:   0.875rem;
  --t-base: 1rem;
  --t-lg:   1.125rem;
  --t-xl:   1.3rem;
  --t-2xl:  1.6rem;
  --t-3xl:  2.05rem;
  --t-4xl:  2.7rem;
  --t-5xl:  3.6rem;
  --t-6xl:  4.6rem;

  /* Elevation */
  --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
  --shadow-md: 0 8px 24px -8px rgba(0,0,0,.5);
  --shadow-lg: 0 24px 60px -16px rgba(0,0,0,.6);
  --shadow-glow: 0 0 0 1px rgba(124,92,255,.35), 0 18px 50px -12px rgba(124,92,255,.55);

  /* Motion */
  --ease: cubic-bezier(.4,0,.2,1);
  --ease-spring: cubic-bezier(.22,1.2,.36,1);
  --dur-fast: 120ms;
  --dur: 200ms;
  --dur-slow: 380ms;

  /* Layout */
  --maxw: 1180px;
  --maxw-prose: 720px;
  --header-h: 68px;
}

/* ----------------------------------------------------------------------------
   2. Reset & Base
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
/* Anchor targets (e.g. #features, #pricing) clear the 68px sticky header instead of hiding under it. */
.section[id], [id].section { scroll-margin-top: 84px; }

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  font-size: var(--t-base);
  line-height: 1.55;
  letter-spacing: -0.011em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  overflow-x: hidden;
}

img, svg, video, canvas { display: block; max-width: 100%; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: none; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; padding: 0; }
:focus-visible { outline: 2px solid var(--brand-400); outline-offset: 2px; border-radius: 4px; }
::selection { background: rgba(124,92,255,.4); color: #fff; }

h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 700; line-height: 1.08; letter-spacing: -0.03em; }
h1 { font-size: var(--t-5xl); }
h2 { font-size: var(--t-4xl); }
h3 { font-size: var(--t-2xl); }

/* Scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--ink-600); border-radius: 999px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: var(--ink-500); }

/* ----------------------------------------------------------------------------
   3. Layout helpers
   -------------------------------------------------------------------------- */
.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--s-6); }
.container--narrow { max-width: 920px; }
.stack { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; }
.row--between { justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; }
.gap-1{gap:var(--s-1)} .gap-2{gap:var(--s-2)} .gap-3{gap:var(--s-3)} .gap-4{gap:var(--s-4)}
.gap-5{gap:var(--s-5)} .gap-6{gap:var(--s-6)} .gap-8{gap:var(--s-8)}
.hidden { display: none !important; }
.text-center { text-align: center; }
.muted { color: var(--text-muted); }
.dim { color: var(--text-dim); }
.mono { font-family: var(--font-mono); }
.nowrap { white-space: nowrap; }
.full { width: 100%; }

/* ----------------------------------------------------------------------------
   4. Typography utilities
   -------------------------------------------------------------------------- */
.eyebrow {
  font-size: var(--t-xs); font-weight: 700; letter-spacing: .14em;
  text-transform: uppercase; color: var(--brand-300);
}
.lead { font-size: var(--t-lg); color: var(--text-muted); line-height: 1.6; }
.gradient-text {
  background: var(--grad-brand);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.gradient-text--money { background: var(--grad-money); -webkit-background-clip: text; background-clip:text; -webkit-text-fill-color: transparent; }

/* ----------------------------------------------------------------------------
   5. Buttons
   -------------------------------------------------------------------------- */
.btn {
  --btn-bg: var(--surface-2);
  --btn-fg: var(--text);
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  height: 44px; padding: 0 var(--s-5);
  border-radius: var(--r-full);
  background: var(--btn-bg); color: var(--btn-fg);
  font-weight: 600; font-size: var(--t-sm); letter-spacing: -0.01em;
  border: 1px solid transparent;
  transition: transform var(--dur-fast) var(--ease), background var(--dur) var(--ease),
              box-shadow var(--dur) var(--ease), opacity var(--dur) var(--ease);
  white-space: nowrap; user-select: none;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(.985); }
.btn svg { width: 18px; height: 18px; }

.btn--primary {
  --btn-fg: #fff;
  background: var(--grad-brand);
  background-size: 160% 160%;
  box-shadow: 0 8px 24px -10px rgba(124,92,255,.8);
}
.btn--primary:hover { box-shadow: 0 12px 32px -8px rgba(124,92,255,.95); }

.btn--money { --btn-fg:#04130d; background: var(--grad-money); box-shadow: 0 8px 24px -10px rgba(34,224,161,.7); }

.btn--solid { --btn-bg: var(--white); --btn-fg: var(--ink-950); }
.btn--solid:hover { background: #fff; }

.btn--ghost { --btn-bg: transparent; border-color: var(--border-strong); }
.btn--ghost:hover { background: var(--surface-2); }

.btn--subtle { --btn-bg: var(--surface-2); }
.btn--subtle:hover { background: var(--surface-3); }

.btn--lg { height: 54px; padding: 0 var(--s-7); font-size: var(--t-base); }
.btn--sm { height: 36px; padding: 0 var(--s-4); font-size: var(--t-xs); }
.btn--icon { width: 44px; padding: 0; }
.btn--icon.btn--sm { width: 36px; }
.btn--block { display: flex; width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

/* ----------------------------------------------------------------------------
   6. Form fields
   -------------------------------------------------------------------------- */
.field { display: flex; flex-direction: column; gap: var(--s-2); }
.field__label { font-size: var(--t-sm); font-weight: 600; color: var(--text); }
.field__hint { font-size: var(--t-xs); color: var(--text-dim); }
.input, .textarea, .select {
  width: 100%; height: 46px; padding: 0 var(--s-4);
  background: var(--ink-900);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  color: var(--text); font-size: var(--t-sm);
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease), background var(--dur) var(--ease);
}
.input::placeholder, .textarea::placeholder { color: var(--ink-400); }
.input:focus, .textarea:focus, .select:focus {
  outline: none; border-color: var(--brand-500);
  box-shadow: 0 0 0 4px rgba(124,92,255,.18);
}
.textarea { height: auto; min-height: 92px; padding: var(--s-3) var(--s-4); resize: vertical; line-height: 1.5; }
.select { appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238b91ad' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; padding-right: 40px;
}
.input-group { display: flex; align-items: center; background: var(--ink-900); border: 1px solid var(--border); border-radius: var(--r-sm); overflow: hidden; transition: border-color var(--dur), box-shadow var(--dur); }
.input-group:focus-within { border-color: var(--brand-500); box-shadow: 0 0 0 4px rgba(124,92,255,.18); }
.input-group__addon { padding: 0 var(--s-3); color: var(--text-dim); font-size: var(--t-sm); font-weight: 500; white-space: nowrap; }
.input-group__addon--lead { border-right: 1px solid var(--border); height: 100%; display: flex; align-items: center; }
.input-group .input { border: none; box-shadow: none; background: transparent; }
.input-group .input:focus { box-shadow: none; }

/* ----------------------------------------------------------------------------
   7. Cards & surfaces
   -------------------------------------------------------------------------- */
.card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--s-6);
}
.panel {
  background: linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,.01));
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
}
.glass {
  background: rgba(20,22,34,.6);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  border: 1px solid var(--border);
}
.divider { height: 1px; background: var(--border); border: 0; width: 100%; }

/* ----------------------------------------------------------------------------
   8. Badges, pills, chips
   -------------------------------------------------------------------------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  height: 24px; padding: 0 10px; border-radius: var(--r-full);
  font-size: var(--t-xs); font-weight: 600;
  background: var(--surface-2); color: var(--text-muted);
  border: 1px solid var(--border);
}
.badge--verified { background: rgba(56,189,248,.14); color: #7dd3fc; border-color: rgba(56,189,248,.3); }
.badge--biz { background: rgba(124,92,255,.16); color: var(--brand-300); border-color: rgba(124,92,255,.32); }
.badge--pro { background: linear-gradient(135deg, rgba(124,92,255,.25), rgba(34,224,161,.2)); color:#fff; border-color: transparent; }
.badge--live { background: rgba(34,224,161,.14); color: var(--money-500); border-color: rgba(34,224,161,.3); }
.pill { display:inline-flex; align-items:center; gap:8px; height:34px; padding:0 14px; border-radius:var(--r-full); background:var(--surface-2); border:1px solid var(--border); font-size:var(--t-sm); font-weight:500; }

.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--money-500); box-shadow: 0 0 0 0 rgba(34,224,161,.6); animation: pulse 2s infinite; }
@keyframes pulse { 0%{box-shadow:0 0 0 0 rgba(34,224,161,.5)} 70%{box-shadow:0 0 0 7px rgba(34,224,161,0)} 100%{box-shadow:0 0 0 0 rgba(34,224,161,0)} }

/* ----------------------------------------------------------------------------
   9. App header / nav
   -------------------------------------------------------------------------- */
.appbar {
  position: sticky; top: 0; z-index: 50;
  height: var(--header-h);
  display: flex; align-items: center;
  border-bottom: 1px solid transparent;
  transition: background var(--dur), border-color var(--dur), backdrop-filter var(--dur);
}
.appbar.is-stuck { background: rgba(8,9,15,.72); backdrop-filter: blur(18px); border-color: var(--border); }
.appbar .container { display: flex; align-items: center; justify-content: space-between; gap: var(--s-5); }
.brand { display: inline-flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 800; font-size: 1.18rem; letter-spacing: -0.03em; }
.brand__mark { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--grad-brand); box-shadow: 0 6px 18px -6px rgba(124,92,255,.8); }
.brand__mark svg { width: 18px; height: 18px; }
.brand b { font-weight: 800; }
.brand span { color: var(--brand-400); }
.nav { display: flex; align-items: center; gap: var(--s-6); }
.nav a { font-size: var(--t-sm); font-weight: 500; color: var(--text-muted); transition: color var(--dur); }
.nav a:hover { color: var(--text); }

/* ----------------------------------------------------------------------------
   10. Toast
   -------------------------------------------------------------------------- */
#toast-root { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 10px; align-items: center; pointer-events: none; }
.toast {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 18px; border-radius: var(--r-full);
  background: rgba(20,22,34,.92); backdrop-filter: blur(14px);
  border: 1px solid var(--border-strong); box-shadow: var(--shadow-lg);
  font-size: var(--t-sm); font-weight: 500; color: #fff;
  animation: toastIn .32s var(--ease-spring);
}
.toast svg { width: 18px; height: 18px; }
.toast--ok svg { color: var(--money-500); }
.toast--err svg { color: var(--danger); }
@keyframes toastIn { from { opacity: 0; transform: translateY(14px) scale(.96); } to { opacity: 1; transform: none; } }
.toast.is-out { animation: toastOut .28s var(--ease) forwards; }
@keyframes toastOut { to { opacity: 0; transform: translateY(8px); } }

/* ----------------------------------------------------------------------------
   10b. Plan / upgrade modal (shared by account + editor gating)
   -------------------------------------------------------------------------- */
.plans { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; text-align: left; }
.plan-opt { border: 1px solid var(--border); border-radius: 16px; padding: 15px 16px; transition: border-color .2s, box-shadow .2s; }
.plan-opt.is-target { border-color: var(--brand-500); box-shadow: var(--shadow-glow); }
.plan-opt.is-current { opacity: .72; }
.plan-opt__top { display: flex; align-items: center; justify-content: space-between; }
.plan-opt__name { font-family: var(--font-display); font-weight: 800; font-size: 1.05rem; }
.plan-opt__name .tag { font-size: 10px; font-weight: 700; letter-spacing: .04em; color: #fff; background: var(--grad-brand); padding: 3px 8px; border-radius: 999px; margin-left: 8px; vertical-align: middle; }
.plan-opt__price { font-family: var(--font-display); font-weight: 800; font-size: 1.2rem; }
.plan-opt__price span { color: var(--text-dim); font-weight: 500; font-size: .78rem; }
.plan-opt__feats { display: flex; flex-wrap: wrap; gap: 6px; margin: 11px 0 13px; }
.plan-opt__feats span { font-size: 11px; color: var(--text-muted); background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; padding: 3px 9px; }
.plan-opt .btn { width: 100%; }
.upgrade-hint { display: inline-flex; align-items: center; gap: 6px; font-size: var(--t-xs); font-weight: 600; color: var(--brand-300); background: rgba(124,92,255,.12); border: 1px solid rgba(124,92,255,.28); padding: 5px 11px; border-radius: 999px; cursor: pointer; }
.upgrade-hint svg { width: 13px; height: 13px; }

/* ----------------------------------------------------------------------------
   10c. Modal (shared base — QR/share specifics live in profile.css)
   -------------------------------------------------------------------------- */
.modal { position: fixed; inset: 0; z-index: 100; display: none; align-items: center; justify-content: center; padding: 22px; }
.modal.is-open { display: flex; }
.modal__scrim { position: absolute; inset: 0; background: rgba(2,3,8,.72); backdrop-filter: blur(6px); animation: fade .2s; }
@keyframes fade { from { opacity: 0; } }
.modal__card { position: relative; width: 100%; max-width: 380px; background: var(--bg-elevated); border: 1px solid var(--border-strong); border-radius: 26px; padding: 26px; text-align: center; box-shadow: var(--shadow-lg); animation: pop .32s var(--ease-spring); max-height: 90vh; overflow-y: auto; }
@keyframes pop { from { opacity: 0; transform: translateY(18px) scale(.96); } }
.modal__close { position: absolute; top: 14px; right: 14px; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; color: var(--text-muted); background: var(--surface-2); z-index: 2; }
.modal__close svg { width: 18px; height: 18px; }
.modal__close:hover { background: var(--surface-3); color: #fff; }
.modal__title { font-family: var(--font-display); font-weight: 700; font-size: 19px; margin-bottom: 4px; }
.modal__sub { color: var(--text-muted); font-size: 13px; margin-bottom: 18px; }
.modal__actions { display: flex; gap: 10px; margin-top: 18px; }

/* ----------------------------------------------------------------------------
   11. Background FX
   -------------------------------------------------------------------------- */
.bg-fx { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.bg-fx::before {
  content: ""; position: absolute; inset: -20%;
  background:
    radial-gradient(40% 50% at 18% 12%, rgba(124,92,255,.22), transparent 60%),
    radial-gradient(35% 45% at 85% 8%, rgba(34,211,238,.16), transparent 60%),
    radial-gradient(45% 55% at 70% 85%, rgba(34,224,161,.10), transparent 60%);
  filter: blur(20px);
}
.bg-grid {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  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: 56px 56px;
  mask-image: radial-gradient(70% 60% at 50% 0%, #000 30%, transparent 80%);
  -webkit-mask-image: radial-gradient(70% 60% at 50% 0%, #000 30%, transparent 80%);
}

/* ----------------------------------------------------------------------------
   12. Animations / reveal
   -------------------------------------------------------------------------- */
[data-reveal] { opacity: 0; transform: translateY(18px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
[data-reveal].is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  [data-reveal] { opacity: 1; transform: none; }
}

.spin { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.skeleton { background: linear-gradient(90deg, var(--ink-800) 25%, var(--ink-700) 37%, var(--ink-800) 63%); background-size: 400% 100%; animation: shimmer 1.4s infinite; border-radius: var(--r-sm); }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }

/* ----------------------------------------------------------------------------
   13. Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 860px) {
  :root { --t-5xl: 2.7rem; --t-4xl: 2.1rem; --t-3xl: 1.7rem; }
  .container { padding-inline: var(--s-5); }
  .nav--main { display: none; }
}
@media (max-width: 520px) {
  :root { --t-5xl: 2.3rem; }
}
