/* Mis Ahorros — neo-fintech UI */
:root {
  --ink: #0b1220;
  --ink-2: #111a2e;
  --text: #0f172a;
  --muted: #64748b;
  --line: #e6eaf2;
  --bg: #f3f6fb;
  --card: #ffffff;
  --mint: #34d399;
  --teal: #06b6d4;
  --indigo: #6366f1;
  --grad: linear-gradient(120deg, #34d399 0%, #06b6d4 55%, #6366f1 100%);
  --pos: #059669;
  --bad: #e11d48;
  --warn: #d97706;
  --r-lg: 28px;
  --r: 18px;
  --r-sm: 12px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 12px 32px -12px rgba(15, 23, 42, .12);
  --shadow-lg: 0 30px 60px -20px rgba(11, 18, 32, .45);
  --ease: cubic-bezier(.2, .8, .2, 1);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color: var(--text);
  background:
    radial-gradient(900px 500px at 100% -10%, rgba(99, 102, 241, .10), transparent 60%),
    radial-gradient(700px 500px at -10% 10%, rgba(52, 211, 153, .10), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: 'tnum' 1, 'ss01' 1;
}
a { color: inherit; }
button { font: inherit; cursor: pointer; }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
h1, h2 { letter-spacing: -.02em; margin: 0; }
.muted { color: var(--muted); }
.pos { color: var(--pos); }
[hidden] { display: none !important; }

.boot { min-height: 100vh; display: grid; place-items: center; }
.boot img { animation: pulse 1.4s var(--ease) infinite; }
@keyframes pulse { 50% { transform: scale(.88); opacity: .6; } }

/* ---------- Logo ---------- */
.logo { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.12rem; letter-spacing: -.02em; text-decoration: none; }
.logo-light { color: #fff; }

/* ---------- Auth ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; }
.auth-hero {
  position: relative; overflow: hidden; color: #e2e8f0; background: var(--ink);
  display: flex; align-items: center; padding: 56px;
}
.auth-hero::before, .auth-hero::after {
  content: ''; position: absolute; border-radius: 50%; filter: blur(70px); opacity: .55;
  animation: drift 14s ease-in-out infinite alternate;
}
.auth-hero::before { width: 460px; height: 460px; background: #10b981; top: -120px; left: -80px; }
.auth-hero::after { width: 520px; height: 520px; background: #6366f1; bottom: -200px; right: -160px; animation-delay: -6s; }
@keyframes drift { to { transform: translate(60px, 40px) scale(1.12); } }
.auth-hero-inner { position: relative; z-index: 1; max-width: 460px; }
.auth-hero h2 { font-size: clamp(2.1rem, 3.6vw, 3.2rem); line-height: 1.05; margin: 40px 0 16px; color: #fff; }
.auth-hero p { font-size: 1.06rem; line-height: 1.6; color: #b6c2d6; }
.hero-points { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 12px; }
.hero-points li {
  display: flex; gap: 12px; align-items: center; padding: 14px 16px; border-radius: 16px;
  background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .09); backdrop-filter: blur(10px);
}
.hero-points li::before { content: '✓'; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 8px; background: var(--grad); color: #fff; font-weight: 800; font-size: .8rem; }
.auth-panel { display: grid; place-items: center; padding: 32px 20px; }
.auth-card { width: 100%; max-width: 430px; animation: rise .5s var(--ease); }
.auth-card h1 { font-size: 2rem; }
.auth-card > .muted { margin: 6px 0 26px; }
.switch { text-align: center; margin-top: 22px; color: var(--muted); }
.switch a { color: var(--indigo); font-weight: 700; text-decoration: none; }

/* ---------- Forms ---------- */
.field { display: grid; gap: 7px; margin-bottom: 16px; }
.field > span { font-size: .85rem; font-weight: 600; color: #334155; }
input, select {
  width: 100%; font: inherit; font-size: 1rem; color: var(--text); background: #fff;
  border: 1.5px solid var(--line); border-radius: var(--r-sm); padding: 13px 14px;
  transition: border-color .2s, box-shadow .2s;
}
input:focus, select:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 4px rgba(6, 182, 212, .15); }
.phone, .money-input { display: flex; align-items: stretch; border: 1.5px solid var(--line); border-radius: var(--r-sm); background: #fff; transition: border-color .2s, box-shadow .2s; }
.phone:focus-within, .money-input:focus-within { border-color: var(--teal); box-shadow: 0 0 0 4px rgba(6, 182, 212, .15); }
.phone input, .money-input input { border: 0; box-shadow: none !important; }
.prefix, .money-input > span { display: grid; place-items: center; padding: 0 4px 0 14px; color: var(--muted); font-weight: 600; }
.hint { color: var(--muted); font-size: .8rem; }
.hint-bad { color: var(--bad); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: .9rem; color: #334155; margin: 4px 0 16px; }
.check input { width: 18px; height: 18px; accent-color: var(--teal); margin-top: 2px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-error { background: #fff1f2; color: #be123c; border: 1px solid #fecdd3; border-radius: var(--r-sm); padding: 11px 14px; font-size: .9rem; margin: 0 0 14px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 14px;
  padding: 14px 20px; font-weight: 700; text-decoration: none; transition: transform .15s var(--ease), box-shadow .2s, opacity .2s;
}
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .65; cursor: progress; }
.btn-primary { color: #fff; background: var(--grad); background-size: 140% 100%; box-shadow: 0 10px 24px -10px rgba(6, 182, 212, .7); }
.btn-primary:hover { background-position: 100% 0; box-shadow: 0 14px 30px -10px rgba(99, 102, 241, .7); }
.btn-ghost { background: #eef2f8; color: var(--text); }
.btn-ghost:hover { background: #e4e9f2; }
.btn-light { background: #fff; color: var(--ink); }
.btn-danger { background: #fff1f2; color: var(--bad); }
.btn-block { width: 100%; }
.btn + .btn-block, .btn-block + .btn-block { margin-top: 10px; }
.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2.5px solid rgba(255, 255, 255, .4); border-top-color: #fff; animation: spin .7s linear infinite; }
.btn-ghost .spinner { border-color: rgba(15, 23, 42, .2); border-top-color: var(--text); }
@keyframes spin { to { transform: rotate(360deg); } }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 999px; border: 0; font-size: .82rem; font-weight: 700; text-decoration: none; background: #eef2f8; color: var(--text); }
.chip svg { width: 16px; height: 16px; }
.icon-btn { border: 0; background: transparent; color: var(--muted); padding: 4px; border-radius: 8px; display: inline-grid; place-items: center; vertical-align: middle; }
.icon-btn:hover { background: #eef2f8; color: var(--text); }
.icon-btn svg { width: 16px; height: 16px; }

/* ---------- Shell ---------- */
.shell { display: grid; grid-template-columns: 264px 1fr; min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 28px; padding: 26px 18px; background: var(--ink); color: #cbd5e1; }
.sidebar .logo { color: #fff; padding: 0 10px; }
.sidebar nav { display: grid; gap: 4px; }
.nav-link { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; text-decoration: none; font-weight: 600; color: #94a3b8; transition: background .2s, color .2s; }
.nav-link:hover { background: rgba(255, 255, 255, .05); color: #e2e8f0; }
.nav-link.active { color: #fff; background: linear-gradient(120deg, rgba(52, 211, 153, .18), rgba(99, 102, 241, .22)); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08); }
.nav-link.active .ico { color: var(--mint); }
.ico { display: grid; place-items: center; }
.sidebar-foot { margin-top: auto; display: flex; gap: 10px; align-items: center; padding: 14px; border-radius: 16px; background: rgba(255, 255, 255, .04); font-size: .8rem; color: #94a3b8; }
.sidebar-foot svg { color: var(--mint); flex: none; }
.main { min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 16px; padding: 18px 32px; background: rgba(243, 246, 251, .75); backdrop-filter: saturate(160%) blur(14px); }
.page-title { font-size: 1.35rem; }
.logo-mobile { display: none; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.badge-demo { font-size: .72rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; padding: 6px 10px; border-radius: 999px; color: #7c3aed; background: #f3e8ff; }
.avatar { width: 40px; height: 40px; border-radius: 14px; display: grid; place-items: center; font-weight: 800; font-size: .9rem; color: #fff; background: var(--grad); text-decoration: none; }
.content { padding: 8px 32px 48px; max-width: 980px; outline: none; animation: rise .45s var(--ease); }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
.tabbar { display: none; }
.greet { font-weight: 700; font-size: 1.1rem; margin: 6px 0 14px; color: #334155; }

/* ---------- Balance card ---------- */
.balance-card {
  position: relative; overflow: hidden; color: #fff; border-radius: var(--r-lg); padding: 28px;
  background: radial-gradient(120% 140% at 0% 0%, #1e293b 0%, var(--ink) 60%); box-shadow: var(--shadow-lg); isolation: isolate;
}
.balance-card::before, .balance-card::after { content: ''; position: absolute; z-index: -1; border-radius: 50%; filter: blur(50px); animation: drift 12s ease-in-out infinite alternate; }
.balance-card::before { width: 280px; height: 280px; background: #10b981; opacity: .45; top: -110px; right: -40px; }
.balance-card::after { width: 300px; height: 300px; background: #6366f1; opacity: .45; bottom: -170px; right: 120px; animation-delay: -5s; }
.bal-label { margin: 0; color: #94a3b8; font-weight: 600; font-size: .9rem; }
.bal-amount { margin: 6px 0 4px; font-size: clamp(2.3rem, 5vw, 3.2rem); font-weight: 800; letter-spacing: -.035em; }
.bal-pending { display: inline-block; font-size: .8rem; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: rgba(251, 191, 36, .16); color: #fcd34d; }
.bal-clabe {
  margin-top: 22px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; padding: 14px 16px; border-radius: 18px;
  background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .1); backdrop-filter: blur(12px);
}
.bal-clabe span { width: 100%; font-size: .78rem; color: #94a3b8; font-weight: 600; }
.bal-clabe strong { font-size: 1.12rem; letter-spacing: .06em; }
.bal-clabe .chip { margin-left: auto; background: rgba(255, 255, 255, .14); color: #fff; }
.skeleton-card { min-height: 220px; }

/* ---------- Panels / quick actions ---------- */
.panel { background: var(--card); border-radius: var(--r-lg); padding: 22px; box-shadow: var(--shadow); margin-top: 18px; border: 1px solid rgba(230, 234, 242, .7); }
.panel h2 { font-size: 1.08rem; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.panel-head a { color: var(--indigo); font-weight: 700; font-size: .9rem; text-decoration: none; }
.form-narrow { max-width: 560px; }
.quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 18px; }
.quick-btn { display: grid; justify-items: center; gap: 10px; padding: 18px 8px; border-radius: 22px; background: #fff; box-shadow: var(--shadow); text-decoration: none; font-weight: 700; font-size: .88rem; transition: transform .2s var(--ease), box-shadow .2s; }
.quick-btn:hover { transform: translateY(-3px); box-shadow: 0 18px 36px -16px rgba(15, 23, 42, .25); }
.quick-btn span { width: 48px; height: 48px; border-radius: 16px; display: grid; place-items: center; color: #fff; background: var(--grad); box-shadow: 0 10px 20px -10px rgba(6, 182, 212, .8); }
.notify-banner { display: flex; align-items: center; gap: 14px; margin-top: 18px; padding: 16px 18px; border-radius: 22px; color: #fff; background: linear-gradient(120deg, #0891b2, #6366f1); box-shadow: 0 16px 32px -16px rgba(99, 102, 241, .7); }
.notify-banner > span { font-size: 1.5rem; }
.notify-banner p { margin: 0; flex: 1; font-size: .92rem; }
.notify-banner .btn { padding: 10px 16px; }

/* ---------- Movements ---------- */
.mov-list, .ben-list { list-style: none; margin: 0; padding: 0; }
.mov { width: 100%; display: flex; align-items: center; gap: 14px; padding: 12px 8px; border: 0; background: transparent; text-align: left; border-radius: 16px; transition: background .2s; }
.mov:hover { background: #f5f7fb; }
.mov-ico { flex: none; width: 44px; height: 44px; border-radius: 15px; display: grid; place-items: center; }
.mov-ico.in { background: #dcfce7; color: var(--pos); }
.mov-ico.out { background: #eef2ff; color: var(--indigo); }
.mov-ico.lg { width: 56px; height: 56px; border-radius: 18px; }
.mov-main { flex: 1; min-width: 0; display: grid; gap: 2px; }
.mov-main strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mov-main small { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mov-amt { text-align: right; font-weight: 800; display: grid; justify-items: end; gap: 4px; white-space: nowrap; }
.pill { display: inline-block; font-size: .72rem; font-weight: 700; padding: 4px 10px; border-radius: 999px; }
.pill-ok { background: #dcfce7; color: #047857; }
.pill-warn { background: #fef3c7; color: #b45309; }
.pill-info { background: #e0f2fe; color: #0369a1; }
.pill-bad { background: #ffe4e6; color: #be123c; }
.empty { display: grid; justify-items: center; gap: 8px; padding: 32px; color: var(--muted); }
.empty svg { width: 36px; height: 36px; opacity: .5; }
.segmented { display: inline-flex; padding: 5px; gap: 4px; border-radius: 16px; background: #e8edf5; }
.segmented button { border: 0; background: transparent; padding: 9px 18px; border-radius: 12px; font-weight: 700; color: var(--muted); }
.segmented button.on { background: #fff; color: var(--text); box-shadow: 0 2px 8px rgba(15, 23, 42, .08); }
.totals { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 10px; }
.totals div { padding: 14px 16px; border-radius: 18px; background: #f5f7fb; display: grid; gap: 2px; }
.totals small { color: var(--muted); font-weight: 600; }
.totals strong { font-size: 1.15rem; }

/* ---------- Detail lists / confirm / receipt ---------- */
.dl { margin: 14px 0; }
.dl-row { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px dashed var(--line); }
.dl-row:last-child { border-bottom: 0; }
.dl dt { color: var(--muted); font-size: .9rem; }
.dl dd { margin: 0; font-weight: 600; text-align: right; word-break: break-word; }
.confirm-amount { font-size: 2.4rem; font-weight: 800; letter-spacing: -.03em; margin: 4px 0 6px; }
.receipt { text-align: center; }
.receipt .dl { text-align: left; }
.receipt-ok { width: 72px; height: 72px; margin: 4px auto 14px; border-radius: 24px; display: grid; place-items: center; color: #fff; background: var(--grad); animation: pop .6s var(--ease); box-shadow: 0 16px 32px -14px rgba(6, 182, 212, .9); }
.receipt-ok svg { width: 32px; height: 32px; }
@keyframes pop { 0% { transform: scale(.4); opacity: 0; } 70% { transform: scale(1.08); } }

/* ---------- Receive ---------- */
.clabe-big { display: grid; gap: 10px; justify-items: center; text-align: center; padding: 26px; margin: 14px 0; border-radius: 24px; color: #fff; background: radial-gradient(120% 140% at 0% 0%, #1e293b, var(--ink)); }
.clabe-big span { color: #94a3b8; font-weight: 700; font-size: .8rem; letter-spacing: .14em; }
.clabe-big strong { font-size: clamp(1.25rem, 4vw, 1.7rem); letter-spacing: .08em; }
.demo-panel { border: 1.5px dashed #c4b5fd; background: linear-gradient(180deg, #faf5ff, #fff); max-width: 560px; }
.demo-panel p { font-size: .9rem; line-height: 1.5; }

/* ---------- Query timeline ---------- */
.timeline { list-style: none; padding: 0; margin: 16px 0; display: grid; gap: 14px; }
.timeline li { position: relative; padding-left: 34px; color: var(--muted); font-weight: 600; }
.timeline li::before { content: ''; position: absolute; left: 0; top: 0; width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--line); background: #fff; }
.timeline li.done { color: var(--text); }
.timeline li.done::before { border: 0; background: var(--grad); box-shadow: 0 0 0 4px rgba(6, 182, 212, .15); }

/* ---------- Beneficiaries / profile ---------- */
.ben { display: flex; align-items: center; gap: 12px; padding: 12px 6px; border-bottom: 1px solid var(--line); }
.ben:last-child { border-bottom: 0; }
.ben-av { flex: none; width: 44px; height: 44px; border-radius: 15px; display: grid; place-items: center; font-weight: 800; color: #fff; background: var(--grad); }
.meter { height: 12px; border-radius: 999px; background: #e8edf5; overflow: hidden; margin: 14px 0 8px; }
.meter span { display: block; height: 100%; border-radius: inherit; background: var(--grad); transition: width .6s var(--ease); }

/* ---------- Skeleton ---------- */
.sk { border-radius: 10px; background: linear-gradient(90deg, rgba(148, 163, 184, .16) 25%, rgba(148, 163, 184, .3) 37%, rgba(148, 163, 184, .16) 63%); background-size: 400% 100%; animation: shimmer 1.3s ease infinite; }
.sk-line { height: 14px; margin: 12px 0; }
.sk-big { height: 44px; width: 60%; margin: 16px 0; }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }

/* ---------- Toasts / modal / deposit ---------- */
#toasts { position: fixed; z-index: 60; right: 20px; bottom: 20px; display: grid; gap: 10px; }
.toast { max-width: 360px; padding: 14px 18px; border-radius: 16px; color: #fff; font-weight: 600; font-size: .92rem; background: var(--ink); box-shadow: var(--shadow-lg); animation: rise .35s var(--ease); transition: opacity .4s, transform .4s; }
.toast-error { background: #be123c; }
.toast.out { opacity: 0; transform: translateY(8px); }
#modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(11, 18, 32, .5); backdrop-filter: blur(6px); animation: fade .25s; }
.modal-card { position: relative; width: 100%; max-width: 480px; max-height: 90vh; overflow: auto; background: #fff; border-radius: var(--r-lg); padding: 24px; box-shadow: var(--shadow-lg); animation: rise .35s var(--ease); }
.modal-head { display: flex; gap: 14px; align-items: center; }
.modal-head h2 { font-size: 1.8rem; margin: 2px 0 6px; }
.modal-head p { margin: 0; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
@keyframes fade { from { opacity: 0; } }
#deposit-alert { position: fixed; z-index: 70; top: 18px; left: 50%; transform: translateX(-50%); width: min(440px, calc(100% - 24px)); }
.deposit-card {
  position: relative; overflow: hidden; display: flex; align-items: center; gap: 14px; padding: 16px 18px; border-radius: 22px; color: #fff;
  background: var(--ink); box-shadow: 0 30px 60px -18px rgba(16, 185, 129, .55); animation: drop .6s var(--ease);
}
.deposit-glow { position: absolute; inset: 0; background: var(--grad); opacity: .28; animation: sweep 2.2s ease-in-out infinite; background-size: 200% 100%; }
@keyframes sweep { 50% { background-position: 100% 0; opacity: .4; } }
@keyframes drop { from { opacity: 0; transform: translateY(-30px) scale(.96); } }
.deposit-ico { position: relative; flex: none; width: 46px; height: 46px; border-radius: 16px; display: grid; place-items: center; background: var(--grad); }
.deposit-ico svg { width: 24px; height: 24px; stroke-width: 2.4; }
.deposit-card > div:not(.deposit-glow) { position: relative; flex: 1; display: grid; gap: 2px; }
.deposit-card small { color: #a7f3d0; font-weight: 700; font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; }
.deposit-card strong { font-size: 1.5rem; letter-spacing: -.02em; }
.deposit-card span { color: #cbd5e1; font-size: .85rem; }
.deposit-card .icon-btn { position: relative; color: #cbd5e1; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .auth { grid-template-columns: 1fr; }
  .auth-hero { padding: 36px 24px 44px; }
  .auth-hero h2 { margin-top: 26px; }
  .hero-points { display: none; }
  .shell { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .logo-mobile { display: inline-flex; }
  .page-title { display: none; }
  .topbar { padding: 14px 18px; }
  .content { padding: 4px 16px 120px; }
  .tabbar {
    display: flex; position: fixed; z-index: 20; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom));
    justify-content: space-around; padding: 8px; border-radius: 24px; background: rgba(11, 18, 32, .88); backdrop-filter: blur(16px); box-shadow: var(--shadow-lg);
  }
  .tabbar .nav-link { flex-direction: column; gap: 3px; padding: 8px 6px; font-size: .68rem; border-radius: 16px; }
  .quick { gap: 8px; }
  .quick-btn { padding: 14px 4px; font-size: .78rem; border-radius: 18px; }
  .quick-btn span { width: 42px; height: 42px; border-radius: 14px; }
  #toasts { left: 16px; right: 16px; bottom: 104px; }
  .toast { max-width: none; }
}
@media (max-width: 420px) {
  .row2 { grid-template-columns: 1fr; }
  .balance-card { padding: 22px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
