
:root {
  --color-primary: #0F172A;
  --color-primary-soft: #1E293B;
  --color-accent: #0F766E;
  --color-accent-dark: #115E59;
  --color-accent-soft: #F0FDFA;
  --color-success: #15803D;
  --color-success-soft: #E8F5E9;
  --color-danger: #B91C1C;
  --color-warning: #B45309;
  --color-warning-soft: #FFF3E0;
  --color-gold: #B7791F;
  --color-gold-soft: #FEF3C7;
  --color-gold-dark: #92640A;
  --color-bg: #F8FAFC;
  --color-surface: #FFFFFF;
  --color-border: #E2E8F0;
  --color-text: #0F172A;
  --color-text-secondary: #475569;
  --shadow-default: 0 1px 2px 0 rgba(15, 23, 42, 0.05);
  --shadow-raised: 0 4px 6px -1px rgba(15, 23, 42, 0.05), 0 2px 4px -2px rgba(15, 23, 42, 0.05);
  --radius-card: 12px;
  --radius-sm: 8px;
  --max-content-width: 1040px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  min-height: 100vh;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

img, svg { max-width: 100%; display: block; }
a { color: var(--color-accent); text-decoration: none; font-weight: 500; }
a:hover { text-decoration: underline; color: var(--color-accent-dark); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: none; }
input, select { -webkit-appearance: none; appearance: none; }
input[type="checkbox"], input[type="radio"] { -webkit-appearance: auto; appearance: auto; }

/* ===== Custom checkbox =====
   The line above only restores the BROWSER's native checkbox as a
   fallback - this block replaces it with a real, on-brand design.
   Every checkbox on the site (consent modals, savings auto-contribute,
   notification preferences, admin permission grids) was previously
   using appearance:none with zero custom styling ever built for it,
   meaning none of them ever visibly showed a checkmark, checked or not. */
input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  min-width: 20px;
  border: 2px solid var(--color-border);
  border-radius: 5px;
  background: var(--color-surface);
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
  transition: background 100ms ease, border-color 100ms ease;
}
input[type="checkbox"]:hover { border-color: var(--color-accent); }
input[type="checkbox"]:checked { background: var(--color-accent); border-color: var(--color-accent); }
input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  left: 6px;
  top: 2px;
  width: 5px;
  height: 10px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
input[type="checkbox"]:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }
input[type="checkbox"]:disabled { opacity: 0.5; cursor: not-allowed; }

/* ===== Layout ===== */
.app-shell {
  width: min(100%, var(--max-content-width));
  margin: 0 auto;
  min-height: 100vh;
  padding-bottom: calc(96px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  background: var(--color-surface);
  border-left: 1px solid var(--color-border);
  border-right: 1px solid var(--color-border);
}
.page-content { padding: 2rem; flex: 1; background: var(--color-bg); }

/* ===== Topbar ===== */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 1rem 2rem; background: var(--color-surface); color: var(--color-primary);
  border-bottom: 1px solid var(--color-border); position: sticky; top: 0; z-index: 20;
}
.brand { display: flex; align-items: center; gap: 0.5rem; font-size: 1.15rem; font-weight: 700; letter-spacing: -0.02em; }
.brand span { color: var(--color-accent); }

.menu-toggle {
  display: none; border: 1px solid var(--color-border); background: var(--color-bg); color: var(--color-primary);
  width: 38px; height: 38px; border-radius: var(--radius-sm); align-items: center; justify-content: center; font-size: 1rem;
}
.menu-toggle:hover { background: var(--color-border); }

.main-nav { display: flex; align-items: center; gap: 0.25rem; }
.main-nav a { color: var(--color-text-secondary); padding: 0.5rem 0.85rem; border-radius: var(--radius-sm); font-size: 0.88rem; font-weight: 500; transition: all 100ms ease; }
.main-nav a:hover { color: var(--color-primary); background: var(--color-bg); text-decoration: none; }
.main-nav a.active { background: var(--color-accent-soft); color: var(--color-accent); font-weight: 600; }
.main-nav a.nav-cta { background: var(--color-primary); color: #fff; }
.main-nav a.nav-cta:hover { background: #000; color: #fff; }

@media (max-width: 720px) {
  .menu-toggle { display: inline-flex; }
  .topbar { padding: 1rem 1.25rem; }
  .page-content { padding: 1.25rem; }
  .main-nav {
    position: absolute; top: calc(100% + 0.25rem); right: 1.25rem;
    flex-direction: column; align-items: stretch; width: 220px;
    background: var(--color-surface); border-radius: var(--radius-sm); border: 1px solid var(--color-border);
    padding: 0.5rem; box-shadow: var(--shadow-raised);
    opacity: 0; visibility: hidden; transform: translateY(-4px); transition: all 120ms ease-out;
  }
  .main-nav.open { opacity: 1; visibility: visible; transform: translateY(0); }
  .main-nav a { width: 100%; padding: 0.75rem 0.85rem; }
}

/* ===== Typography ===== */
h1, h2, h3 { margin: 0; color: var(--color-primary); font-weight: 700; letter-spacing: -0.015em; }
h1 { font-size: 1.75rem; line-height: 1.2; }
h2 { font-size: 1.35rem; margin-bottom: 1rem; }
h3 { font-size: 1.05rem; }
p { color: var(--color-text-secondary); font-size: 0.92rem; }

/* ===== Cards ===== */
.card {
  background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-card);
  padding: 1.75rem; box-shadow: var(--shadow-default); margin-bottom: 1.25rem;
}
.card h3 { margin-bottom: 0.5rem; }
.card-clickable { cursor: pointer; }
.card-clickable:hover { border-color: #CBD5E1; }

.list-row {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 1rem 1.25rem; background: var(--color-bg); border-radius: var(--radius-sm);
  border: 1px solid var(--color-border); margin-bottom: 0.5rem;
}
.list-row:last-child { margin-bottom: 0; }

/* ===== Forms ===== */
.field { margin-bottom: 1.25rem; }
.field label { display: block; margin-bottom: 0.4rem; font-weight: 500; color: var(--color-primary); font-size: 0.85rem; }
.field input, .field select, .field textarea {
  width: 100%; padding: 0.7rem 0.9rem; border: 1px solid var(--color-border); border-radius: var(--radius-sm);
  background: var(--color-surface); color: var(--color-primary); font-size: 0.92rem; transition: border-color 100ms ease;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--color-accent); }
.field input::placeholder { color: #94A3B8; }
.filter-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.9rem; }
@media (max-width: 640px) { .filter-row { grid-template-columns: 1fr; } }

/* ===== Buttons ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; width: 100%;
  border-radius: var(--radius-sm); padding: 0.8rem 1.25rem; font-weight: 600; font-size: 0.9rem;
  border: 1px solid transparent; transition: all 100ms ease;
}
.btn:active { transform: scale(0.99); }
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--color-accent); color: #fff; }
.btn-primary:hover { background: var(--color-accent-dark); }
.btn-secondary { background: var(--color-surface); color: var(--color-primary); border-color: var(--color-border); box-shadow: var(--shadow-default); }
.btn-secondary:hover { background: var(--color-bg); }
.btn-accent { background: var(--color-primary); color: #fff; }
.btn-accent:hover { background: #000; }
.btn-danger { background: var(--color-danger); color: #fff; }
.btn-link { background: none; border: none; color: var(--color-text-secondary); width: auto; padding: 0.8rem 0.5rem; }
.btn-link:hover { color: var(--color-primary); }
.btn-small { width: auto; padding: 0.55rem 1rem; font-size: 0.82rem; }

/* ===== Financial elements ===== */
.stat-label { font-size: 0.75rem; letter-spacing: 0.03em; text-transform: uppercase; color: var(--color-text-secondary); font-weight: 600; }
.stat-value { font-size: 2rem; font-weight: 700; color: var(--color-primary); letter-spacing: -0.02em; margin-top: 0.25rem; }
.amount-positive { color: var(--color-success); font-weight: 600; }
.amount-negative { color: var(--color-danger); font-weight: 600; }
.small-text { font-size: 0.78rem; color: var(--color-text-secondary); }

.progress-bar { background: var(--color-border); border-radius: 4px; height: 0.4rem; overflow: hidden; }
.progress-fill { background: var(--color-accent); height: 100%; transition: width 200ms ease; }
.progress-fill-gold { background: linear-gradient(90deg, var(--color-gold) 0%, #D4A017 100%); height: 100%; transition: width 200ms ease; }

.badge { display: inline-flex; align-items: center; justify-content: center; padding: 0.3rem 0.6rem; border-radius: 4px; font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.02em; }
.badge-success { background: var(--color-success-soft); color: var(--color-success); }
.badge-gold { background: var(--color-gold-soft); color: var(--color-gold-dark); }
.badge-warning { background: var(--color-warning-soft); color: var(--color-warning); }
.badge-neutral { background: var(--color-bg); color: var(--color-text-secondary); border: 1px solid var(--color-border); }
.badge-danger { background: #FEE2E2; color: var(--color-danger); }

/* ===== Onboarding / empty states ===== */
.onboarding-step { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.85rem 0; border-bottom: 1px solid var(--color-border); }
.onboarding-step:last-child { border-bottom: none; }
.onboarding-step-label { display: flex; align-items: center; gap: 0.75rem; font-size: 0.88rem; color: var(--color-text); }
.onboarding-step-index {
  width: 22px; height: 22px; border-radius: 50%; background: var(--color-bg); color: var(--color-text-secondary);
  font-size: 0.7rem; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--color-border);
}
.onboarding-step.done .onboarding-step-index { background: var(--color-success); color: #fff; border-color: var(--color-success); }

.empty-state { text-align: center; padding: 2.5rem 1rem; }
.empty-state-icon { width: 36px; height: 36px; margin: 0 auto 0.75rem; color: var(--color-text-secondary); opacity: 0.6; }
.empty-state h3 { margin-bottom: 0.25rem; font-size: 1rem; }
.empty-state p { max-width: 24rem; margin: 0 auto 1rem; }

/* ===== Utility ===== */
.hidden { display: none !important; }
.message { font-size: 0.85rem; }
.message-error { color: var(--color-danger); }
.message-info { color: var(--color-text-secondary); }
.text-center { text-align: center; }
.mt-4 { margin-top: 1.5rem; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.flex-between .btn { width: auto; flex: 1; min-width: 0; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; }
@media (max-width: 720px) { .grid-2 { grid-template-columns: 1fr; } }

/* ===== Landing page: hero ===== */
.hero { padding: 1rem 0 2.5rem; }
.hero-copy { max-width: 42rem; }
.hero-eyebrow { display: inline-flex; margin-bottom: 1rem; padding: 0.35rem 0.75rem; border-radius: 999px; background: var(--color-accent-soft); color: var(--color-accent-dark); font-size: 0.72rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }
.hero-title { font-size: clamp(1.9rem, 4vw, 2.7rem); line-height: 1.15; font-weight: 700; letter-spacing: -0.02em; margin-bottom: 1rem; }
.hero-description { font-size: 1rem; color: var(--color-text-secondary); margin-bottom: 1.5rem; max-width: 36rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; margin-bottom: 2rem; }
.hero-actions .btn { width: auto; min-width: 10rem; }

.hero-illustration { margin: 1.5rem 0 2rem; }
.hero-illustration svg { width: 100%; height: auto; max-height: 260px; }

.stats-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.85rem; }
.stats-card { background: var(--color-surface); border-radius: var(--radius-card); padding: 1rem 1.1rem; text-align: center; border: 1px solid var(--color-border); }
.stats-card strong { display: block; font-size: 1.4rem; color: var(--color-primary); font-weight: 700; }
.stats-card span { display: block; margin-top: 0.3rem; color: var(--color-text-secondary); font-size: 0.76rem; }
@media (max-width: 640px) { .stats-grid { grid-template-columns: 1fr; } }

/* ===== Trust bar ===== */
.trust-bar { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-bottom: 2rem; }
.trust-pill { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.5rem 0.9rem; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: 999px; font-size: 0.8rem; font-weight: 600; color: var(--color-text-secondary); }
.trust-icon { width: 8px; height: 8px; border-radius: 50%; background: var(--color-accent); display: inline-block; }

/* ===== Product cards ===== */
.savings-options { margin-bottom: 2rem; }
.product-card { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-card); padding: 1.75rem; }
.product-card.group-accent { background: var(--color-primary); border-color: var(--color-primary); }
.product-card.group-accent h2, .product-card.group-accent p { color: #fff; }
.product-card.group-accent p { color: rgba(255,255,255,0.72); }
.product-badge { display: inline-flex; padding: 0.3rem 0.7rem; border-radius: 999px; background: var(--color-bg); color: var(--color-text-secondary); font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 0.9rem; }
.product-badge.accent { background: rgba(255,255,255,0.12); color: #5EEAD4; }
.product-card h2 { margin-bottom: 0.6rem; font-size: 1.25rem; }
.product-card p { margin-bottom: 1.25rem; }
.product-card .btn { width: auto; }

/* ===== Workflow / section headers ===== */
.workflow-section { padding: 2rem; }
.section-header { margin-bottom: 1.5rem; }
.section-header p { margin-top: 0.4rem; }
.feature-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
@media (max-width: 860px) { .feature-grid { grid-template-columns: 1fr; } }
.feature-card { background: var(--color-bg); border: 1px solid var(--color-border); border-radius: var(--radius-card); padding: 1.4rem; }
.feature-card.internal { background: var(--color-surface); }
.feature-card h3 { margin-bottom: 0.5rem; font-size: 0.98rem; }
.feature-card p { font-size: 0.86rem; }
.step-number { font-size: 0.8rem; font-weight: 700; color: var(--color-accent); margin-bottom: 0.6rem; }
.icon-wrap { width: 32px; height: 32px; border-radius: 8px; background: var(--color-accent-soft); margin-bottom: 0.8rem; }

/* ===== Section inverted (feature deep dive) ===== */
.section-inverted { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-card); padding: 2rem; margin-bottom: 1.5rem; }
.topnav { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1.25rem; }
.pill { display: inline-flex; padding: 0.35rem 0.75rem; border-radius: 999px; background: var(--color-bg); border: 1px solid var(--color-border); color: var(--color-text-secondary); font-size: 0.74rem; font-weight: 600; }
.section-lead { max-width: 42rem; margin-bottom: 1.5rem; }

/* ===== Pricing / fees ===== */
.pricing-section { padding: 2rem; }
.fees-list { margin-top: 0.5rem; }
.fee-info strong { display: block; color: var(--color-primary); font-size: 0.92rem; margin-bottom: 0.2rem; }
.fee-info span { font-size: 0.8rem; color: var(--color-text-secondary); }
.fee-tag { font-size: 0.78rem; font-weight: 700; color: var(--color-primary); white-space: nowrap; }
.fee-tag.optional { color: var(--color-warning); }
.fee-tag.free { color: var(--color-success); }

/* ===== Bottom nav ===== */
.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; width: 100%; max-width: var(--max-content-width);
  margin: 0 auto; display: flex; justify-content: space-around;
  background: var(--color-surface); border-top: 1px solid var(--color-border); padding: 0.5rem 0; z-index: 15;
  padding-bottom: calc(0.5rem + env(safe-area-inset-bottom));
  box-shadow: 0 -2px 8px rgba(15, 23, 42, 0.04);
}
.bottom-nav a { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.15rem; font-size: 0.68rem; color: var(--color-text-secondary); font-weight: 500; }
.bottom-nav a.active { color: var(--color-accent); font-weight: 600; }
.nav-icon { width: 20px; height: 20px; }
.nav-icon svg { width: 100%; height: 100%; stroke: currentColor; }

/* ===== Footer ===== */
.site-footer { border-top: 1px solid var(--color-border); padding: 1.5rem 2rem; background: var(--color-surface); margin-top: auto; }
.site-footer .footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.site-footer .footer-links { display: flex; gap: 1.25rem; }
.site-footer .footer-links a { color: var(--color-text-secondary); font-size: 0.82rem; font-weight: 400; }
.site-footer .footer-links a:hover { color: var(--color-accent); }
.site-footer .footer-copy { color: var(--color-text-secondary); font-size: 0.82rem; }

@media (max-width: 600px) {
  .site-footer { padding: 1.5rem 1.25rem; }
  .site-footer .footer-inner { flex-direction: column-reverse; align-items: flex-start; gap: 1rem; }
  .list-row { flex-direction: column; align-items: flex-start; gap: 0.5rem; }
  .stats-grid { grid-template-columns: 1fr; }
}

/* ===== Password input with toggle button ===== */
.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}
.input-wrapper input {
  padding-right: 2.75rem; /* leave room for the toggle icon */
}
.toggle-password-btn {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-secondary);
  background: none;
  border: none;
  cursor: pointer;
}
.toggle-password-btn:hover { color: var(--color-primary); }
.toggle-password-btn .eye-icon {
  width: 100%;
  height: 100%;
  stroke: currentColor;
}

/* ===== Added: topbar icon buttons (notification bell, quick logout) =====
   Kept flat and consistent with the rest of the system - no gradients,
   just the existing border/hover language used everywhere else. */
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: var(--radius-sm);
  color: var(--color-text-secondary); position: relative;
  transition: background 100ms ease, color 100ms ease;
}
.icon-btn:hover { background: var(--color-bg); color: var(--color-primary); }
.icon-btn svg { width: 20px; height: 20px; }

.notif-badge {
  position: absolute; top: 2px; right: 2px;
  background: var(--color-danger); color: #fff;
  font-size: 0.62rem; font-weight: 700; line-height: 1.4;
  border-radius: 999px; padding: 0 4px; min-width: 15px; text-align: center;
}

/* ===== Added: search field used on the Groups > Discover page ===== */
.search-field { position: relative; margin-bottom: 1rem; }
.search-field input {
  width: 100%; padding: 0.7rem 0.9rem 0.7rem 2.4rem; border: 1px solid var(--color-border);
  border-radius: var(--radius-sm); background: var(--color-surface); font-size: 0.9rem;
}
.search-field input:focus { outline: none; border-color: var(--color-accent); }
.search-field svg {
  position: absolute; left: 0.8rem; top: 50%; transform: translateY(-50%);
  width: 16px; height: 16px; color: var(--color-text-secondary); pointer-events: none;
}

/* ===== Added: referral card link input (read-only, copyable) ===== */
.copy-field { display: flex; gap: 0.5rem; }
.copy-field input[readonly] { background: var(--color-bg); cursor: text; }

/* ===== Added: table used on admin users page rendered inline before,
   now shares the same card/border language as the rest of the app ===== */
.data-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.data-table th, .data-table td { text-align: left; padding: 0.6rem 0.5rem; border-bottom: 1px solid var(--color-border); }
.data-table th { color: var(--color-text-secondary); font-weight: 600; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.03em; }

/* ===== Added: FAQ accordion on the landing page =====
   Native <details>/<summary>, styled to match the existing card language
   instead of raw unstyled browser defaults - no JS needed for the
   collapse behavior itself. */
.faq-item {
  border-bottom: 1px solid var(--color-border);
  padding: 1rem 0;
}
.faq-item:last-of-type { border-bottom: none; }
.faq-item summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--color-text);
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: '+';
  flex-shrink: 0;
  font-size: 1.2rem;
  font-weight: 400;
  color: var(--color-accent);
  transition: transform 150ms ease;
}
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item p {
  margin-top: 0.75rem;
  color: var(--color-text-secondary);
  font-size: 0.9rem;
  line-height: 1.6;
}

/* ===== Added: redesigned dashboard (wallet hero, stat grid, activity feed) ===== */
.greeting-header h1 { font-size: 1.4rem; margin-bottom: 0.2rem; }
.greeting-header p { color: var(--color-text-secondary); font-size: 0.9rem; }

.wallet-hero {
  background: linear-gradient(135deg, var(--color-primary) 0%, #142a4a 60%, #123b3a 100%);
  color: #fff;
  border-radius: var(--radius-card);
  padding: 1.5rem;
  margin-top: 1rem;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}
.wallet-hero-label { display: flex; align-items: center; gap: 0.5rem; font-size: 0.85rem; color: #CBD5E1; margin-bottom: 0.6rem; }
.wallet-hero-label button { background: none; border: none; color: #CBD5E1; cursor: pointer; padding: 2px; display: inline-flex; }
.wallet-hero-balance { font-size: 2rem; font-weight: 700; letter-spacing: -0.01em; }
.wallet-hero-sub { font-size: 0.8rem; color: #94A3B8; margin-top: 0.4rem; }
.wallet-hero-icon {
  width: 44px; height: 44px; border-radius: var(--radius-sm);
  border: 1.5px solid #334155; display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}

.stat-grid-2x2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; margin-top: 1rem; }
.stat-card-mini {
  background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-card);
  padding: 1rem; display: flex; flex-direction: column; justify-content: space-between; min-height: 108px;
}
.stat-card-mini-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.5rem; }
.stat-card-mini-label { font-size: 0.78rem; color: var(--color-text-secondary); font-weight: 600; }
.stat-card-mini-value { font-size: 1.3rem; font-weight: 700; color: var(--color-text); margin-top: 0.5rem; }
.stat-card-mini-sub { font-size: 0.75rem; color: var(--color-text-secondary); margin-top: 0.15rem; }
.stat-card-mini-icon {
  width: 34px; height: 34px; border-radius: 999px; background: var(--color-accent-soft);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.stat-card-mini-icon.warm { background: var(--color-warning-soft); }
.stat-card-mini-icon svg { width: 18px; height: 18px; }

.progress-ring-wrap { display: flex; align-items: center; justify-content: center; }
.progress-ring-wrap svg { transform: rotate(-90deg); }

.activity-list-item {
  display: flex; align-items: center; gap: 0.75rem; padding: 0.75rem 0; border-bottom: 1px solid var(--color-border);
}
.activity-list-item:last-child { border-bottom: none; }
.activity-icon {
  width: 38px; height: 38px; border-radius: 999px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.activity-icon svg { width: 18px; height: 18px; }
.activity-icon.credit { background: var(--color-success-soft); color: var(--color-success); }
.activity-icon.debit { background: var(--color-accent-soft); color: var(--color-accent); }
.activity-icon.pending { background: var(--color-warning-soft); color: var(--color-warning); }
.activity-details { flex: 1; min-width: 0; }
.activity-details .title { font-size: 0.88rem; font-weight: 600; color: var(--color-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.activity-details .time { font-size: 0.75rem; color: var(--color-text-secondary); margin-top: 0.1rem; }
.activity-amount { text-align: right; flex-shrink: 0; }
.activity-amount .amount { font-size: 0.9rem; font-weight: 700; }
.activity-amount .amount.credit { color: var(--color-success); }
.activity-amount .amount.debit { color: var(--color-text); }
.activity-amount .status { font-size: 0.72rem; color: var(--color-text-secondary); margin-top: 0.1rem; }

.balance-hidden { filter: blur(7px); user-select: none; }

/* ===== Added: savings page hero + per-goal ring layout ===== */
.savings-hero {
  background: var(--color-accent-soft);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  padding: 1.5rem;
  margin-top: 1rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
}
.savings-hero-value { font-size: 1.6rem; font-weight: 700; color: var(--color-text); }
.savings-hero-label { font-size: 0.85rem; color: var(--color-text-secondary); margin-top: 0.15rem; }
.goal-card-header { display: flex; align-items: center; gap: 1rem; }
.goal-card-header .goal-info { flex: 1; min-width: 0; }

/* ===== Added: scroll-reveal animations (landing page) =====
   Respects prefers-reduced-motion - people with vestibular disorders can
   get real motion sickness from scroll animation, so it becomes an
   instant, static reveal for them instead of an animated one. */
.reveal-on-scroll, .stagger-fade {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal-on-scroll.revealed, .stagger-fade.revealed { opacity: 1; transform: translateY(0); }

.stagger-fade .feature-card, .stagger-fade .stats-card, .stagger-fade .product-card {
  opacity: 0; transform: translateY(16px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.stagger-fade.revealed .feature-card, .stagger-fade.revealed .stats-card, .stagger-fade.revealed .product-card {
  opacity: 1; transform: translateY(0);
}
.stagger-fade .feature-card:nth-child(2), .stagger-fade .stats-card:nth-child(2), .stagger-fade .product-card:nth-child(2) { transition-delay: 90ms; }
.stagger-fade .feature-card:nth-child(3), .stagger-fade .stats-card:nth-child(3) { transition-delay: 180ms; }

@media (prefers-reduced-motion: reduce) {
  .reveal-on-scroll, .stagger-fade, .stagger-fade .feature-card, .stagger-fade .stats-card, .stagger-fade .product-card {
    transition: none !important;
  }
}

/* Gentle hover lift - already-existing cards get a touch of life without
   needing any JS at all. */
.product-card, .feature-card, .stats-card {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.product-card:hover, .feature-card:hover, .stats-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-raised);
}
@media (prefers-reduced-motion: reduce) {
  .product-card, .feature-card, .stats-card { transition: none; }
  .product-card:hover, .feature-card:hover, .stats-card:hover { transform: none; }
}

/* Very slow, subtle rotation on the hero's rotation-guide ring, tying the
   motion directly to the actual product mechanic instead of generic
   decorative animation. */
@media (prefers-reduced-motion: no-preference) {
  .hero-illustration .rotation-ring { animation: rotate-slowly 40s linear infinite; transform-origin: center; }
}
@keyframes rotate-slowly { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

/* ===== Added: phone mockup ("see it in action" section) =====
   A proper iPhone-style frame (graphite bezel, side buttons, Dynamic
   Island, home indicator) rather than a plain rounded rectangle. The
   screen content still reuses the dashboard's real CSS classes - this
   guarantees the marketing preview can never structurally drift from
   the actual product - just with richer, more varied color specifically
   for this showcase instance (see the mockup-colorful overrides below),
   since a landing-page visual is allowed a bit more vibrancy than the
   everyday utility app screen it's advertising. Still zero gradients.*/
.phone-mockup {
  position: relative;
  width: 100%;
  max-width: 260px;
  aspect-ratio: 9 / 19.5;
  margin: 0 auto;
  background: #15181F;
  border-radius: 46px;
  padding: 14px 9px;
  box-shadow: var(--shadow-raised);
}
.phone-btn {
  position: absolute;
  background: #0B0D12;
  border-radius: 3px;
  z-index: 1;
}
.phone-btn-mute { left: -3px; top: 96px; width: 3px; height: 24px; }
.phone-btn-vol-up { left: -3px; top: 130px; width: 3px; height: 38px; }
.phone-btn-vol-down { left: -3px; top: 174px; width: 3px; height: 38px; }
.phone-btn-power { right: -3px; top: 134px; width: 3px; height: 56px; }

.phone-island {
  position: absolute;
  top: 20px; left: 50%; transform: translateX(-50%);
  width: 68px; height: 18px;
  background: #000;
  border-radius: 999px;
  z-index: 3;
  display: flex; align-items: center; justify-content: flex-end;
  padding-right: 8px;
}
.phone-camera-dot {
  width: 5px; height: 5px; border-radius: 50%;
  background: #262B36;
}
.phone-screen {
  background: var(--color-bg);
  border-radius: 32px;
  overflow: hidden;
  height: 100%;
  position: relative;
  display: flex;
  flex-direction: column;
}
.phone-content-scroll {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  padding: 2.1rem 0.9rem 0;
}
.phone-bottom-nav {
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 0.5rem 0 1.1rem;
  border-top: 1px solid var(--color-border);
  background: var(--color-surface);
  flex-shrink: 0;
}
.phone-bottom-nav .phone-nav-icon {
  width: 18px; height: 18px; color: var(--color-text-secondary);
}
.phone-bottom-nav .phone-nav-icon.active { color: var(--color-accent); }
.phone-bottom-nav svg { width: 100%; height: 100%; stroke: currentColor; fill: none; }
.phone-home-indicator {
  position: absolute;
  bottom: 8px; left: 50%; transform: translateX(-50%);
  width: 100px; height: 4px;
  background: #0B0D12;
  border-radius: 999px;
  z-index: 3;
  opacity: 0.55;
}
.phone-scale-wrap {
  transform: scale(0.64);
  transform-origin: top left;
  width: calc(100% / 0.64);
}

/* Richer color specifically for the landing-page phone mockup, scoped to
   .mockup-colorful so none of this touches the real dashboard elsewhere
   in the app - still flat, solid fills only, no gradients. */
.mockup-colorful .wallet-hero-balance { color: #FBBF24; }
.mockup-colorful .stat-card-mini:nth-child(1) .stat-card-mini-icon { background: #CCFBF1; }
.mockup-colorful .stat-card-mini:nth-child(3) .stat-card-mini-icon { background: #FDE68A; }
.mockup-colorful .stat-card-mini:nth-child(4) .stat-card-mini-icon { background: #BBF7D0; }

/* ===== Added: group rotation circle (group-detail.html) =====
   A circular "who's paid, who's next, who's waiting" visualization,
   computed from real group data - not decorative, an actual status view.
   Colors follow the app's existing palette (no new hues introduced). */
.rotation-circle-legend { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 1rem; justify-content: center; }
.rotation-legend-chip {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.35rem 0.75rem; border-radius: 999px; font-size: 0.74rem; font-weight: 600;
  background: var(--color-bg); border: 1px solid var(--color-border); color: var(--color-text-secondary);
}
.rotation-legend-chip .dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.rotation-legend-chip.paid .dot { background: var(--color-primary); }
.rotation-legend-chip.next .dot { background: var(--color-warning); }
.rotation-legend-chip.waiting .dot { background: var(--color-border); border: 1px solid #CBD5E1; }

/* ===== Added: reusable collapsible card pattern (verification review,
   payment history, etc.) - native <details>/<summary>, no JS needed for
   the open/close behavior itself. Distinct from .faq-item (which is
   tuned for the landing page) - this one is meant for use throughout the
   authenticated app and admin panel. */
.collapsible-card {
  background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-card);
  padding: 1.25rem 1.5rem; margin-bottom: 1rem;
}
.collapsible-card summary {
  cursor: pointer; font-weight: 600; font-size: 0.95rem; color: var(--color-primary);
  list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.collapsible-card summary::-webkit-details-marker { display: none; }
.collapsible-card summary::after {
  content: '▾'; flex-shrink: 0; font-size: 1.1rem; font-weight: 700; color: var(--color-accent);
  background: var(--color-accent-soft); border-radius: 50%;
  width: 28px; height: 28px; display: flex; align-items: center; justify-content: center;
  transition: transform 150ms ease;
}
.collapsible-card[open] summary::after { transform: rotate(180deg); }
.collapsible-card .collapsible-body { margin-top: 1rem; }

.verification-photo-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.75rem; margin: 0.75rem 0; }
.verification-photo-grid img { width: 100%; height: 100px; object-fit: cover; border-radius: var(--radius-sm); border: 1px solid var(--color-border); }
@media (max-width: 600px) { .verification-photo-grid { grid-template-columns: 1fr 1fr; } }

.name-mismatch-warning {
  background: var(--color-warning-soft); border: 1px solid #FCD34D; color: #92400E;
  padding: 0.6rem 0.9rem; border-radius: var(--radius-sm); font-size: 0.82rem; font-weight: 600; margin: 0.5rem 0;
}

/* ===== Added: fixed-height scrollable list box (dashboard Recent Activity) =====
   Different treatment from .collapsible-card on purpose - this is a
   quick "at a glance" home-screen widget, so it stays visible and
   scrollable rather than something you'd tuck away open/closed. */
.scrollable-list-box {
  max-height: 320px;
  overflow-y: auto;
  padding-right: 0.25rem; /* keeps content clear of the scrollbar */
}
.scrollable-list-box::-webkit-scrollbar { width: 6px; }
.scrollable-list-box::-webkit-scrollbar-track { background: transparent; }
.scrollable-list-box::-webkit-scrollbar-thumb { background: var(--color-border); border-radius: 999px; }
.scrollable-list-box::-webkit-scrollbar-thumb:hover { background: #CBD5E1; }

/* ===== Added: reusable consent modal (join group, create group, register) =====
   Interrupts the flow at the moment of commitment - a stronger "I
   definitely saw this" signal than content sitting inline on the page,
   which someone could scroll past while filling in other fields. */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(15, 23, 42, 0.6);
  display: flex; align-items: center; justify-content: center;
  z-index: 200; padding: 1rem;
}
.modal-overlay.hidden { display: none; }
.modal-box {
  background: var(--color-surface); border-radius: var(--radius-card);
  max-width: 480px; width: 100%; max-height: 85vh;
  display: flex; flex-direction: column; overflow: hidden;
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.25);
}
.modal-header {
  padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--color-border);
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.modal-header h3 { font-size: 1.05rem; }
.modal-close-btn {
  width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--color-text-secondary); font-size: 1.1rem; line-height: 1;
}
.modal-close-btn:hover { background: var(--color-bg); color: var(--color-primary); }
.modal-body {
  padding: 1.25rem 1.5rem; overflow-y: auto; flex: 1;
  font-size: 0.85rem; line-height: 1.7; color: var(--color-text-secondary);
}
.modal-body ul { padding-left: 1.2rem; margin-top: 0.5rem; }
.modal-footer {
  padding: 1.1rem 1.5rem; border-top: 1px solid var(--color-border);
  display: flex; flex-direction: column; gap: 0.9rem;
}
.modal-agree-row { display: flex; align-items: center; gap: 0.6rem; font-size: 0.85rem; cursor: pointer; }
.modal-agree-row input { width: auto; }

/* ===== Added: small "?" info icon — taps open a plain-language
   explanation via showInfoModal, for any field/choice that needs more
   context than a label alone can give. */
.info-icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--color-bg); border: 1px solid var(--color-border);
  color: var(--color-text-secondary); font-size: 0.72rem; font-weight: 700;
  cursor: pointer; flex-shrink: 0; line-height: 1;
}
.info-icon-btn:hover { background: var(--color-accent-soft); color: var(--color-accent); border-color: var(--color-accent); }
