@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700;800&display=swap');
/* Shared design tokens + global foundation — single source of truth for both apps. */
@import url('tokens.css');

/* ==========================================================================
   Maffooz Pay — Customer App — Minimal Design System
   Mobile-first. Apple / Stripe / CRED inspired.
   ========================================================================== */

:root {
    /* App-specific tokens only. All shared design tokens (brand, surfaces, text,
       motion, shape, shadow, spacing, scales) now live in tokens.css, imported
       above, so customer + merchant cannot drift. UI_OPTIMIZATION.md sec 6.1. */

    /* Layout */
    --header-h: 64px;

    /* Z-index scale (shared z-* are in tokens.css) */
    --z-header: 40;

    /* ──────────────────────────────────────────────────────────────────
       Compatibility aliases — legacy customer-only names mapped onto
       the canonical merchant names above. New code should use the
       merchant names (--bg-app, --text-main, --surface-1, --radius-md).
       ────────────────────────────────────────────────────────────── */
    --bg: var(--bg-app);                /* legacy: solid background */
    --bg-elevated: var(--surface-2);    /* legacy: elevated solid surface */
    --surface: var(--surface-1);        /* legacy: card surface */
    --surface-hover: var(--surface-1);  /* legacy: hover state */
    --text: var(--text-main);           /* legacy: primary text */
    --radius: var(--radius-lg);         /* legacy: large radius */
    --radius-full: 999px;               /* pill rounded */
    --page-x: var(--pad-page-x);        /* legacy: horizontal page padding */
}


*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
* { font-family: 'Inter', system-ui, sans-serif; }
html { -webkit-text-size-adjust: 100%; }
body { background: var(--bg-gradient); color: var(--text-main); min-height: 100vh; overflow-x: hidden; -webkit-font-smoothing: antialiased; line-height: 1.5; }
img, svg { max-width: 100%; height: auto; display: block; }
/* Lucide renders <i> as inline <svg>; ensure they don't break absolute positioning */
[data-lucide] { display: inline-block; vertical-align: middle; flex-shrink: 0; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, select, textarea { font-family: inherit; }
h1, h2, h3, h4, .outfit { font-family: 'Outfit', sans-serif; color: var(--text-strong); font-weight: 700; line-height: 1.15; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.001s !important; transition-duration: 0.001s !important; }
}


/* === App Shell === */
.app { display: flex; flex-direction: column; min-height: 100vh; }
.app-header {
    position: sticky; top: 0; z-index: 50;
    height: var(--header-h);
    display: flex; align-items: center; gap: 12px;
    padding: 0 var(--page-x);
    background: rgba(5, 1, 13, 0.88);
    backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--card-border);
}
.app-header .brand { display: flex; align-items: center; gap: 8px; flex-shrink: 0; text-decoration: none; }
.app-header .brand .logo-text { font-family: 'Outfit', sans-serif; font-size: 22px; font-weight: 800; background: linear-gradient(to right, var(--primary), var(--secondary)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; letter-spacing: -0.5px; }
.app-header .brand .logo-badge { background: var(--accent); color: #000; font-size: 9px; font-weight: 700; padding: 2px 6px; border-radius: 4px; text-transform: uppercase; letter-spacing: 0.4px; }
.app-header .spacer { flex: 1; }
.app-header .header-search { flex: 1; max-width: 560px; position: relative; display: flex; align-items: center; }
.app-header .header-search :is(i, svg) { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--text-muted); pointer-events: none; z-index: 1; }
.app-header .header-search input { width: 100%; background: var(--surface); border: 1px solid rgba(42,35,71,0.8); border-radius: var(--radius-full); padding: 11px 16px 11px 42px; color: var(--text-strong); font-size: 15px; min-height: 44px; display: block; transition: var(--transition); }
.app-header .header-search input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-glow); }
@media (max-width: 767px) { .app-header .header-search { display: none; } }
.header-link { display: flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: var(--radius-sm); color: var(--text-muted); font-size: 13px; font-weight: 600; transition: var(--transition); min-height: 40px; white-space: nowrap; }
.header-link:hover { color: var(--text-strong); background: rgba(255,255,255,0.04); }
.header-link :is(i, svg) { width: 18px; height: 18px; }
.header-link .label { }
@media (max-width: 767px) { .header-link .label { display: none; } .header-link { padding: 8px; } }
.header-avatar { width: 34px; height: 34px; border-radius: 50%; border: 1.5px solid var(--primary); overflow: hidden; flex-shrink: 0; }
.header-avatar img { width: 100%; height: 100%; object-fit: cover; }


/* === Page content === */
.page { flex: 1; padding: 20px var(--page-x) 24px; max-width: 1400px; width: 100%; margin: 0 auto; }
@media (min-width: 768px) { .page { padding-bottom: 40px; } }


/* === Location chip === */
.loc-chip { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: var(--radius-full); background: rgba(255,255,255,0.03); border: 1px solid var(--card-border); font-size: 13px; font-weight: 600; color: var(--text); cursor: pointer; transition: var(--transition); min-height: 40px; }
.loc-chip:hover { border-color: var(--primary); }
.loc-chip :is(i, svg) { width: 14px; height: 14px; color: var(--primary); flex-shrink: 0; }
.loc-chip .name { max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 360px) { .loc-chip .name { max-width: 140px; } }

/* === Category chips (horizontal scroll) === */
.cat-chips { display: flex; gap: 10px; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; padding: 4px 0; }
.cat-chips::-webkit-scrollbar { display: none; }
.cat-chip { display: inline-flex; align-items: center; gap: 6px; padding: 10px 18px; border-radius: var(--radius-full); background: var(--surface-2); border: 1px solid var(--card-border); box-shadow: 0 2px 8px rgba(17,17,40,0.05); font-size: 13px; font-weight: 600; color: var(--text-muted); white-space: nowrap; transition: var(--transition); min-height: 40px; flex-shrink: 0; cursor: pointer; text-decoration: none; }
.cat-chip:hover { color: var(--text-strong); background: var(--surface); border-color: rgba(255,255,255,0.12); }
.cat-chip.is-active { background: linear-gradient(135deg, var(--primary), var(--secondary)); border-color: transparent; color: #fff; box-shadow: 0 4px 14px var(--primary-glow); }
.cat-chip :is(i, svg) { width: 14px; height: 14px; }

/* === Filter bar (category rail + advanced filters button) === */
.filter-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; }
.filter-bar .cat-chips { flex: 1; min-width: 0; margin: 0; }
.filters-btn { flex-shrink: 0; position: relative; display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 9px 15px; border: none; border-radius: var(--radius-full); background: var(--text-strong); color: var(--surface-2); font-size: 13px; font-weight: 700; cursor: pointer; transition: var(--transition); }
.filters-btn :is(i, svg) { width: 16px; height: 16px; }
.filters-btn:active { transform: scale(0.97); }
.filters-count { position: absolute; top: -5px; right: -5px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 999px; background: var(--secondary); color: #fff; font-size: 10px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; }
.filters-count[hidden] { display: none; }

/* === Advanced filters bottom sheet === */
.filter-sheet { position: fixed; inset: 0; z-index: 100; }
.filter-sheet[hidden] { display: none; }
.filter-sheet__backdrop { position: absolute; inset: 0; background: rgba(20, 20, 43, 0.5); }
.filter-sheet__panel { position: absolute; left: 0; right: 0; bottom: 0; max-width: 640px; margin: 0 auto; background: var(--surface-2); border-radius: 24px 24px 0 0; padding: 8px 18px calc(18px + env(safe-area-inset-bottom, 0px)); box-shadow: 0 -12px 40px rgba(20, 20, 43, 0.25); }
.filter-sheet__handle { width: 40px; height: 5px; background: var(--card-border); border-radius: 999px; margin: 6px auto 14px; }
.filter-sheet__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.filter-sheet__title { font-family: 'Outfit'; font-size: 19px; font-weight: 800; color: var(--text-strong); letter-spacing: -0.3px; }
.filter-sheet__clear { background: none; border: none; color: var(--secondary); font-size: 13px; font-weight: 700; cursor: pointer; }
.filter-sheet__label { margin: 0 0 8px; font-size: 13px; font-weight: 700; color: var(--text-muted); }
.filter-opts { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.filter-opt { background: var(--bg-app); color: var(--text-muted); border: 1px solid var(--card-border); font-size: 12px; font-weight: 600; padding: 7px 14px; border-radius: 999px; cursor: pointer; transition: var(--transition); }
.filter-opt.is-selected { background: var(--primary-soft); color: var(--primary); border: 1.5px solid var(--primary); font-weight: 700; }
.filter-row { display: flex; align-items: center; justify-content: space-between; padding: 11px 0; border-top: 1px solid var(--divider); }
.filter-row > span { display: inline-flex; align-items: center; gap: 9px; font-size: 14px; font-weight: 600; color: var(--text-strong); }
.filter-row > span :is(i, svg) { width: 18px; height: 18px; color: var(--secondary); }
.filter-apply { width: 100%; margin-top: 18px; min-height: 50px; font-size: 15px; }

/* === Section header === */
.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.section-title { font-family: 'Outfit'; font-size: 18px; font-weight: 800; color: var(--text-strong); letter-spacing: -0.3px; }

/* === Shop card grid === */
/* auto-fill (not auto-fit): keep empty tracks so a single card stays ~320px wide on a
   wide desktop instead of stretching to fill the whole row. */
.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 24px; }
@media (max-width: 639px) { .shop-grid { grid-template-columns: 1fr; gap: 20px; } }


/* === Shop card === */
.shop-card { position: relative; border-radius: 18px; overflow: hidden; background: var(--surface-2); border: 1px solid var(--card-border); transition: var(--transition); display: flex; flex-direction: column; box-shadow: 0 6px 16px rgba(17,17,40,0.06), 0 18px 40px rgba(17,17,40,0.12); height: 390px; cursor: pointer; }
.shop-card:hover { border-color: var(--primary); transform: translateY(-4px) scale(1.02); box-shadow: var(--shadow-lg); }
.shop-card:active { transform: translateY(-2px) scale(0.98); }
.shop-card.is-offline { opacity: 0.5; filter: grayscale(0.4); }
.shop-card .img-wrap { width: 100%; aspect-ratio: 16 / 9; overflow: hidden; position: relative; background: var(--bg-elevated); }
.shop-card .img-wrap img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1); filter: brightness(0.95); }
.shop-card:hover .img-wrap img { transform: scale(1.05); }
.shop-card .img-wrap::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(248,250,252,0.85) 0%, rgba(248,250,252,0.1) 50%, transparent 100%); pointer-events: none; }
.shop-card .cashback-badge { position: absolute; top: 12px; left: 12px; background: linear-gradient(135deg, var(--primary), var(--secondary)); color: #fff; font-size: 13px; font-weight: 800; padding: 6px 14px; border-radius: var(--radius-full); display: flex; align-items: center; gap: 5px; box-shadow: 0 6px 16px var(--primary-glow); z-index: 2; letter-spacing: 0.3px; }
.shop-card .cashback-badge :is(i, svg) { width: 12px; height: 12px; stroke-width: 3; }
.shop-card .status-badge { position: absolute; top: 12px; right: 12px; z-index: 2; font-size: 11px; font-weight: 700; padding: 4px 11px; border-radius: var(--radius-full); background: var(--surface-2); box-shadow: 0 2px 8px rgba(17,17,40,0.14); }
.shop-card .status-badge.is-open { color: #059669; }
.shop-card .status-badge.is-closed { color: var(--text-muted); }
.shop-card .body { padding: 16px 18px 8px; display: flex; flex-direction: column; gap: 6px; flex: 1; min-height: 0; }
.shop-card .meta-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
.shop-card .meta-row .category { color: var(--primary); }
.shop-card .meta-row .distance { color: var(--accent); display: flex; align-items: center; gap: 3px; }
.shop-card .meta-row .distance :is(i, svg) { width: 11px; height: 11px; }
.shop-card .title { font-family: 'Outfit'; font-size: 21px; font-weight: 800; color: var(--text-strong); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; letter-spacing: -0.4px; }
.shop-card .rating { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; color: var(--accent); background: var(--accent-soft); padding: 3px 10px; border-radius: 6px; align-self: flex-start; }
.shop-card .rating :is(i, svg) { width: 11px; height: 11px; fill: var(--accent); }
.shop-card .cta { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 12px; margin: 4px 18px 16px; border-radius: var(--radius-sm); background: linear-gradient(135deg, var(--accent), var(--secondary)); color: #000; font-size: 14px; font-weight: 700; transition: var(--transition); min-height: 46px; text-decoration: none; box-shadow: 0 6px 18px rgba(217,119,6,0.28); z-index: 5; }
.shop-card .cta:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(217,119,6,0.36); }
.shop-card .cta :is(i, svg) { width: 16px; height: 16px; }

/* === Shop card — mobile compact mode ========================================
   Desktop keeps the fixed 390px height so grid cards stay uniform. On a single
   mobile column that height makes each card fill the whole screen ("too big"
   to browse). Override here so phones get a shorter, scannable list feel:
   auto height (driven by content), a smaller image, tighter padding/gaps and
   a slightly smaller title + CTA. Lets ~1.5 cards show per screen.
   ========================================================================== */
@media (max-width: 639px) {
    .shop-grid { gap: 14px; }
    .shop-card { height: auto; }
    .shop-card .img-wrap { height: 140px; }
    .shop-card .body { padding: 12px 14px 6px; gap: 4px; }
    .shop-card .title { font-size: 17px; }
    .shop-card .cta { margin: 4px 14px 12px; padding: 11px; min-height: 44px; font-size: 13px; }
}


/* === Mobile search (shown on home only) === */
.mobile-search { position: relative; margin-bottom: 18px; display: flex; align-items: center; }
.mobile-search :is(i, svg) { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--text-muted); pointer-events: none; z-index: 1; }
.mobile-search input { width: 100%; background: var(--surface); border: 1px solid rgba(42,35,71,0.8); border-radius: var(--radius-full); padding: 14px 18px 14px 46px; color: var(--text-strong); font-size: 16px; min-height: 52px; display: block; transition: var(--transition); box-shadow: 0 4px 16px rgba(0,0,0,0.2); }
.mobile-search input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-glow), 0 4px 16px rgba(0,0,0,0.2); }
@media (min-width: 768px) { .mobile-search { display: none; } }

/* === Empty state === */
.empty-state { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 48px 16px; gap: 10px; }
.empty-state .icon { width: 64px; height: 64px; border-radius: 50%; background: var(--primary-soft); display: flex; align-items: center; justify-content: center; margin-bottom: 4px; }
.empty-state .icon :is(i, svg) { width: 28px; height: 28px; color: var(--primary); }
.empty-state h3 { font-size: 18px; margin: 0; }
.empty-state p { color: var(--text-muted); font-size: 14px; max-width: 360px; margin: 0; }
.empty-state .btn { margin-top: 12px; }

/* === Buttons === */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 18px; border-radius: var(--radius-sm); font-size: 14px; font-weight: 600; transition: var(--transition); min-height: 44px; text-decoration: none; }
.btn :is(i, svg) { width: 16px; height: 16px; }
.btn-primary { background: linear-gradient(135deg, var(--accent), var(--secondary)); color: #000; box-shadow: 0 4px 14px var(--accent-glow); }
.btn-primary:hover { transform: translateY(-1px); }
.btn-secondary { background: rgba(255,255,255,0.04); border: 1px solid var(--card-border); color: var(--text); }
.btn-secondary:hover { background: rgba(255,255,255,0.07); }


/* === History cards === */
.history-list { display: flex; flex-direction: column; gap: 10px; }
.history-card { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: var(--radius-sm); background: var(--card-bg); border: 1px solid var(--card-border); transition: var(--transition); min-width: 0; }
.history-card:hover { border-color: rgba(139,92,246,0.25); }
.history-card .icon-circle { width: 42px; height: 42px; border-radius: 50%; background: var(--primary-soft); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.history-card .icon-circle :is(i, svg) { width: 18px; height: 18px; color: var(--primary); }
.history-card .info { flex: 1; min-width: 0; }
.history-card .shop-name { font-size: 14px; font-weight: 600; color: var(--text-strong); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history-card .date { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.history-card .amounts { text-align: right; flex-shrink: 0; }
.history-card .paid { font-family: 'Outfit'; font-size: 15px; font-weight: 700; color: var(--text-strong); }
.history-card .cashback { font-size: 11px; font-weight: 600; color: var(--success); margin-top: 2px; }

/* === Profile === */
.profile-header { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 32px 0; text-align: center; }
.profile-header .avatar { width: 72px; height: 72px; border-radius: 50%; border: 2px solid var(--primary); overflow: hidden; }
.profile-header .avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile-header .name { font-size: 20px; font-weight: 700; }
.profile-header .phone { font-size: 13px; color: var(--text-muted); font-family: monospace; }
.stat-pill { display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; border-radius: var(--radius-full); background: var(--success-soft); border: 1px solid rgba(16,185,129,0.3); }
.stat-pill .value { font-family: 'Outfit'; font-size: 16px; font-weight: 800; color: var(--success); }
.stat-pill .label { font-size: 12px; color: var(--text-muted); }
.profile-menu { display: flex; flex-direction: column; gap: 6px; margin-top: 24px; max-width: 400px; width: 100%; margin-left: auto; margin-right: auto; }
.profile-link { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: var(--radius-sm); background: var(--card-bg); border: 1px solid var(--card-border); color: var(--text); font-size: 14px; font-weight: 500; transition: var(--transition); min-height: 52px; }
.profile-link:hover { border-color: rgba(139,92,246,0.3); background: rgba(255,255,255,0.03); }
.profile-link :is(i, svg) { width: 20px; height: 20px; color: var(--text-muted); }
.profile-link .arrow { margin-left: auto; width: 16px; height: 16px; color: var(--text-faint); }
.profile-link.is-danger { color: #f87171; }
.profile-link.is-danger :is(i, svg) { color: #f87171; }


/* === Payment success === */
.success-card { max-width: 440px; width: 100%; margin: 0 auto; text-align: center; padding: 40px 24px; }
.success-icon { width: 88px; height: 88px; border-radius: 50%; background: var(--success-soft); border: 2px solid var(--success); display: flex; align-items: center; justify-content: center; margin: 0 auto 20px; animation: successPulse 0.6s ease; }
.success-icon :is(i, svg) { width: 40px; height: 40px; color: var(--success); animation: successCheck 0.4s 0.2s ease both; }
@keyframes successPulse { 0% { transform: scale(0.7); opacity: 0; } 50% { transform: scale(1.1); } 100% { transform: scale(1); opacity: 1; } }
@keyframes successCheck { 0% { transform: scale(0) rotate(-20deg); opacity: 0; } 100% { transform: scale(1) rotate(0); opacity: 1; } }
.success-amount { font-family: 'Outfit'; font-size: 36px; font-weight: 800; color: var(--text-strong); margin: 16px 0 4px; letter-spacing: -0.5px; }
.cashback-highlight { display: inline-flex; align-items: center; gap: 8px; background: linear-gradient(135deg, rgba(245,158,11,0.15), rgba(236,72,153,0.10)); border: 1px solid rgba(245,158,11,0.35); padding: 10px 20px; border-radius: var(--radius-full); margin: 16px 0 28px; animation: fadeIn 0.4s 0.3s ease both; }
.cashback-highlight .emoji { font-size: 20px; }
.cashback-highlight .text { font-family: 'Outfit'; font-size: 17px; font-weight: 800; color: var(--accent); }
.success-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* === Shop detail bottom sheet (mobile) / side drawer (desktop) === */
.shop-sheet { position: fixed; inset: 0; z-index: 100; display: none; }
.shop-sheet.is-open { display: flex; }
.shop-sheet .overlay { position: absolute; inset: 0; background: rgba(0,0,0,0.5); }
@media (max-width: 767px) {
    .shop-sheet .panel { position: absolute; bottom: 0; left: 0; right: 0; max-height: 92vh; overflow-y: auto; background: var(--bg-elevated); border-top-left-radius: 20px; border-top-right-radius: 20px; padding: 24px var(--page-x) calc(env(safe-area-inset-bottom, 0px) + 24px); animation: slideUp 0.25s ease; }
}
@media (min-width: 768px) {
    .shop-sheet .panel { position: absolute; top: 0; right: 0; bottom: 0; width: 480px; max-width: 100%; overflow-y: auto; background: var(--bg-elevated); border-left: 1px solid var(--card-border); padding: 32px; animation: slideRight 0.2s ease; }
}
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
@keyframes slideRight { from { transform: translateX(100%); } to { transform: translateX(0); } }
.shop-sheet .handle { width: 40px; height: 4px; border-radius: 2px; background: rgba(255,255,255,0.15); margin: 0 auto 16px; }
@media (min-width: 768px) { .shop-sheet .handle { display: none; } }
.shop-sheet .close-btn { position: absolute; top: 16px; right: 16px; width: 36px; height: 36px; border-radius: 50%; background: rgba(255,255,255,0.06); display: flex; align-items: center; justify-content: center; color: var(--text-muted); transition: var(--transition); }
.shop-sheet .close-btn:hover { background: rgba(255,255,255,0.1); color: var(--text-strong); }
.shop-sheet .close-btn :is(i, svg) { width: 18px; height: 18px; }


/* === Bill input inside sheet === */
.bill-section { margin-top: 20px; }
.bill-input-wrap { position: relative; margin-bottom: 12px; }
.bill-input-wrap .prefix { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); font-size: 20px; font-weight: 700; color: var(--text); }
.bill-input-wrap input { width: 100%; background: rgba(255,255,255,0.04); border: 1px solid var(--card-border); border-radius: var(--radius-sm); padding: 14px 16px 14px 40px; font-size: 22px; font-weight: 700; color: var(--text-strong); min-height: 56px; transition: var(--transition); }
.bill-input-wrap input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-glow); }
.cashback-preview { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--success-soft); border: 1px solid rgba(16,185,129,0.25); margin-bottom: 16px; }
.cashback-preview .label { font-size: 13px; color: var(--text-muted); }
.cashback-preview .value { font-family: 'Outfit'; font-size: 18px; font-weight: 800; color: var(--success); }
.pay-btn { width: 100%; min-height: 52px; border-radius: var(--radius-sm); background: linear-gradient(135deg, var(--accent), var(--secondary)); color: #000; font-size: 16px; font-weight: 700; display: flex; align-items: center; justify-content: center; gap: 8px; transition: var(--transition); box-shadow: 0 6px 20px var(--accent-glow); }
.pay-btn:hover:not(:disabled) { transform: translateY(-1px); }
.pay-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.pay-btn :is(i, svg) { width: 18px; height: 18px; }

/* === Alerts === */
.alert { display: flex; align-items: flex-start; gap: 8px; padding: 10px 14px; border-radius: var(--radius-sm); font-size: 13px; margin-bottom: 14px; line-height: 1.4; }
.alert :is(i, svg) { width: 14px; height: 14px; flex-shrink: 0; margin-top: 2px; }
.alert-error { background: var(--error-soft); border: 1px solid rgba(239,68,68,0.3); color: #fca5a5; }
.alert-success { background: var(--success-soft); border: 1px solid rgba(16,185,129,0.3); color: #34d399; }

/* === Toasts (non-blocking feedback) === */
.toast-host { position: fixed; left: 50%; top: calc(env(safe-area-inset-top, 0px) + 16px); transform: translateX(-50%); z-index: var(--z-toast, 200); display: flex; flex-direction: column; gap: 10px; width: min(92vw, 420px); pointer-events: none; }
.toast { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--surface-2, rgba(15,11,32,0.95)); border: 1px solid var(--card-border); border-left: 3px solid var(--primary); box-shadow: var(--shadow-lg); color: var(--text-main); font-size: 13px; line-height: 1.4; backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); pointer-events: auto; opacity: 0; transform: translateY(-12px); transition: opacity 0.25s ease, transform 0.25s ease; }
.toast.is-visible { opacity: 1; transform: translateY(0); }
.toast :is(i, svg) { width: 16px; height: 16px; flex-shrink: 0; margin-top: 1px; }
.toast .toast-msg { flex: 1; min-width: 0; }
.toast .toast-close { background: transparent; border: 0; color: var(--text-faint); cursor: pointer; padding: 2px; display: inline-flex; align-items: center; }
.toast .toast-close:hover { color: var(--text-main); }
.toast--error { border-left-color: var(--error); }
.toast--error > :is(i, svg):first-child { color: var(--error); }
.toast--success { border-left-color: var(--success); }
.toast--success > :is(i, svg):first-child { color: var(--success); }
.toast--info { border-left-color: var(--info); }
.toast--info > :is(i, svg):first-child { color: var(--info); }
@media (prefers-reduced-motion: reduce) { .toast { transition: opacity 0.01ms; transform: none; } }

/* === Utilities === */
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-accent { color: var(--accent); }
.font-mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.animate-in { animation: fadeIn 0.3s ease; }

/* === Location autocomplete === */
.loc-search-box { position: relative; display: flex; align-items: center; }
.loc-search-box :is(i, svg) { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 14px; height: 14px; color: var(--text-muted); pointer-events: none; }
.loc-search-box input { width: 100%; background: rgba(255,255,255,0.04); border: 1px solid var(--card-border); border-radius: var(--radius-full); padding: 10px 14px 10px 36px; color: var(--text-strong); font-size: 14px; min-height: 42px; display: block; transition: var(--transition); }
.loc-search-box input:focus { outline: none; border-color: var(--primary); }
.loc-dropdown { position: absolute; top: calc(100% + 6px); left: 0; right: 0; background: rgba(11,6,32,0.97); backdrop-filter: blur(16px); border: 1px solid var(--card-border); border-radius: var(--radius-sm); z-index: 100; max-height: 260px; overflow-y: auto; box-shadow: 0 12px 32px rgba(0,0,0,0.5); display: none; }
.loc-dropdown.is-open { display: block; }
.loc-item { display: flex; align-items: flex-start; gap: 10px; padding: 10px 14px; cursor: pointer; border-bottom: 1px solid var(--card-border); transition: var(--transition); }
.loc-item:last-child { border-bottom: 0; }
.loc-item:hover { background: rgba(255,255,255,0.03); }
.loc-item :is(i, svg) { width: 14px; height: 14px; color: var(--primary); flex-shrink: 0; margin-top: 2px; }
.loc-item .primary-text { font-size: 13px; font-weight: 600; color: var(--text-strong); }
.loc-item .secondary-text { font-size: 11px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }


/* === Auth page (login) — keep from previous redesign === */
.auth-shell { background: radial-gradient(1100px 600px at 80% -10%, rgba(245,158,11,0.10), transparent 60%), radial-gradient(900px 600px at -10% 110%, rgba(139,92,246,0.18), transparent 60%), var(--bg); min-height: 100vh; display: flex; flex-direction: column; overflow-x: hidden; }
.auth-nav { display: flex; align-items: center; justify-content: space-between; padding: 14px var(--page-x); height: 64px; flex-shrink: 0; border-bottom: 1px solid var(--card-border); background: rgba(5,1,13,0.55); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }
.auth-nav .brand { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; }
.auth-nav .brand .logo-text { font-family: 'Outfit'; font-size: clamp(20px,3vw,24px); font-weight: 800; background: linear-gradient(to right, var(--primary), var(--secondary)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.auth-nav .brand .logo-badge { background: var(--accent); color: #000; font-size: 10px; font-weight: 700; padding: 2px 6px; border-radius: 4px; text-transform: uppercase; letter-spacing: 0.4px; }
.auth-nav .merchant-link { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: var(--radius-full); background: rgba(255,255,255,0.04); border: 1px solid var(--card-border); color: var(--text); font-size: 13px; font-weight: 600; transition: var(--transition); text-decoration: none; min-height: 40px; white-space: nowrap; }
.auth-nav .merchant-link:hover { background: rgba(255,255,255,0.07); border-color: rgba(245,158,11,0.4); }
.auth-nav .merchant-link :is(i, svg) { width: 14px; height: 14px; }
.auth-hero { flex: 1; width: 100%; max-width: 1400px; margin: 0 auto; padding: 24px var(--page-x); display: grid; grid-template-columns: 1fr; gap: 28px; align-items: center; }
@media (min-width: 1024px) { .auth-hero { grid-template-columns: minmax(0,11fr) minmax(0,9fr); gap: 56px; padding: 48px clamp(24px,4vw,48px); min-height: calc(100vh - 64px); } }
.auth-brand-story { display: none; }
@media (min-width: 1024px) { .auth-brand-story { display: flex; flex-direction: column; gap: 28px; max-width: 560px; } }
.auth-brand-story .eyebrow { display: inline-flex; align-items: center; gap: 8px; align-self: flex-start; background: var(--primary-soft); border: 1px solid rgba(139,92,246,0.45); color: #6d28d9; padding: 6px 12px; border-radius: var(--radius-full); font-size: 12px; font-weight: 600; }
.auth-brand-story .eyebrow :is(i, svg) { width: 14px; height: 14px; }
.auth-brand-story h1 { font-family: 'Outfit'; font-size: clamp(38px,4.6vw,56px); line-height: 1.05; font-weight: 800; letter-spacing: -1.5px; color: var(--text-strong); }
.auth-brand-story h1 .accent { background: linear-gradient(to right, var(--primary), var(--secondary)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.auth-brand-story .lede { font-size: 16px; line-height: 1.6; color: var(--text-muted); max-width: 480px; }
.trust-metrics { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; padding: 16px; background: rgba(255,255,255,0.03); border: 1px solid var(--card-border); border-radius: var(--radius); backdrop-filter: blur(12px); }
.trust-stat { display: flex; flex-direction: column; gap: 2px; padding: 8px; border-right: 1px solid var(--card-border); }
.trust-stat:last-child { border-right: 0; }
.trust-stat .value { font-family: 'Outfit'; font-size: clamp(18px,2.5vw,22px); font-weight: 800; color: var(--text-strong); }
.trust-stat .label { font-size: 11px; color: var(--text-muted); font-weight: 500; }
.phone-mockup { align-self: center; max-width: 260px; width: 100%; filter: drop-shadow(0 30px 50px rgba(139,92,246,0.25)); }


/* Auth card + OTP components */
.auth-card { position: relative; width: 100%; max-width: 440px; margin: 0 auto; padding: clamp(28px,4vw,40px); border-radius: 24px; background: rgba(15,11,32,0.62); backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px); border: 1px solid rgba(255,255,255,0.10); box-shadow: 0 24px 60px rgba(0,0,0,0.45); overflow: hidden; }
.auth-card::before { content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; background: linear-gradient(135deg, rgba(245,158,11,0.45), rgba(236,72,153,0.25) 50%, transparent 100%); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; pointer-events: none; }
.auth-card::after { content: ""; position: absolute; inset: 0; border-radius: inherit; background: radial-gradient(420px 220px at 30% 0%, rgba(245, 158, 11, 0.18), transparent 60%); pointer-events: none; z-index: 0; }
.auth-card > * { position: relative; z-index: 1; }
.auth-step-header { text-align: center; margin-bottom: 22px; }
.auth-step-header h2 { font-size: clamp(22px,3vw,26px); margin: 0 0 6px; }
.auth-step-header .sub { font-size: 14px; color: var(--text-muted); margin: 0; }

/* Icon tile that sits above each step's heading — matches the merchant
   login's amber-tinted square pill */
.auth-icon-tile {
    width: 56px;
    height: 56px;
    margin: 0 auto 14px;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.18) 0%, rgba(236, 72, 153, 0.14) 100%);
    border: 1px solid rgba(245, 158, 11, 0.30);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
}
.auth-icon-tile :is(i, svg) { width: 28px; height: 28px; }
.auth-input { width: 100%; background: rgba(9,7,20,0.5); border: 1px solid var(--card-border); border-radius: 12px; color: var(--text-strong); font-size: 16px; transition: var(--transition); min-height: 52px; padding: 12px 16px; }
.auth-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-glow); }
.auth-phone-input { position: relative; }
.auth-phone-input .prefix { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--text); font-weight: 600; font-size: 15px; padding-right: 10px; border-right: 1px solid var(--card-border); pointer-events: none; }
.auth-phone-input .auth-input { padding-left: 64px; letter-spacing: 0.5px; }
.auth-cta { width: 100%; min-height: 52px; border-radius: 12px; background: linear-gradient(135deg, var(--accent) 0%, var(--secondary) 100%); color: #000; font-weight: 700; font-size: 15px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; transition: var(--transition); cursor: pointer; border: none; box-shadow: 0 8px 24px var(--accent-glow); }
.auth-cta:not(:disabled):hover { transform: translateY(-1px); box-shadow: 0 12px 28px var(--accent-glow); }
.auth-cta:disabled { cursor: not-allowed; opacity: 0.65; transform: none; }
.auth-cta :is(i, svg) { width: 18px; height: 18px; }
.auth-pill-back { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 12px 10px 14px; background: rgba(255,255,255,0.03); border: 1px solid var(--card-border); border-radius: 12px; font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 18px; }
.auth-pill-back button { color: var(--primary); font-size: 12px; font-weight: 700; background: transparent; border: none; cursor: pointer; padding: 6px 10px; border-radius: 8px; display: inline-flex; align-items: center; gap: 4px; transition: var(--transition); }
.auth-pill-back button:hover { background: rgba(139,92,246,0.1); }
.otp-boxes { display: grid; grid-template-columns: repeat(6,1fr); gap: 8px; margin-bottom: 8px; }
@media (max-width: 480px) { .otp-boxes { gap: 6px; } }
@media (max-width: 360px) { .otp-boxes { gap: 4px; } }
.otp-box { aspect-ratio: 1; width: 100%; min-width: 0; padding: 0; box-sizing: border-box; border-radius: 12px; background: rgba(9,7,20,0.5); border: 1.5px solid var(--card-border); color: var(--text-strong); font-family: 'Outfit'; font-size: clamp(18px,4.5vw,26px); font-weight: 700; text-align: center; transition: var(--transition); }
.otp-box:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-glow); background: rgba(139,92,246,0.08); }
.otp-box.is-filled { border-color: rgba(139,92,246,0.4); background: rgba(139,92,246,0.06); }
.otp-box.is-error { border-color: rgba(239,68,68,0.6); box-shadow: 0 0 0 3px rgba(239,68,68,0.2); animation: otpShake 0.4s; }
@keyframes otpShake { 10%,90% { transform: translateX(-2px); } 20%,80% { transform: translateX(3px); } 30%,50%,70% { transform: translateX(-4px); } 40%,60% { transform: translateX(4px); } }
.auth-resend { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 16px; font-size: 13px; color: var(--text-muted); }
.auth-resend button { color: var(--primary); font-weight: 700; background: transparent; border: none; cursor: pointer; padding: 6px 8px; border-radius: 6px; transition: var(--transition); font-size: 13px; }
.auth-resend button:hover:not(:disabled) { background: rgba(139,92,246,0.1); }
.auth-resend button:disabled { color: var(--text-faint); cursor: not-allowed; }
.otp-sim-toast { background: linear-gradient(135deg, rgba(245,158,11,0.18), rgba(245,158,11,0.08)); border: 1px solid rgba(245,158,11,0.4); border-left-width: 4px; color: #fde68a; padding: 12px 14px; border-radius: 10px; margin-bottom: 18px; font-size: 13px; display: none; animation: fadeIn 0.35s ease; }
.otp-sim-toast.is-visible { display: flex; gap: 10px; align-items: flex-start; }
.otp-sim-toast .label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.4px; font-weight: 700; color: rgba(253,230,138,0.85); }
.otp-sim-toast .code { font-family: monospace; font-size: 18px; font-weight: 800; color: var(--text-strong); letter-spacing: 2px; margin-top: 2px; }
.auth-error { background: var(--error-soft); border: 1px solid rgba(239,68,68,0.3); color: #fca5a5; padding: 10px 12px; border-radius: 10px; margin-bottom: 16px; font-size: 13px; display: none; align-items: flex-start; gap: 8px; }
.auth-error.is-visible { display: flex; }
.auth-error :is(i, svg) { width: 14px; height: 14px; flex-shrink: 0; margin-top: 2px; }
.auth-step { display: none; }
.auth-step.is-active { display: block; animation: fadeIn 0.32s ease; }
.auth-fineprint { margin-top: 18px; font-size: 11px; color: var(--text-faint); line-height: 1.6; text-align: center; }
.auth-fineprint a { color: var(--text-muted); text-decoration: underline; }
.auth-secondary { width: 100%; max-width: 1400px; margin: 0 auto; padding: 0 var(--page-x) 32px; display: flex; flex-direction: column; gap: 16px; }
@media (min-width: 1024px) { .auth-secondary { display: none; } }
.benefit-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 360px) { .benefit-cards { grid-template-columns: 1fr; } }
.benefit-card { display: flex; flex-direction: column; gap: 6px; padding: 14px; border-radius: 12px; background: rgba(255,255,255,0.025); border: 1px solid var(--card-border); }
.benefit-card .icon-tile { width: 32px; height: 32px; border-radius: 8px; background: var(--primary-soft); color: var(--primary); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.benefit-card .icon-tile :is(i, svg) { width: 16px; height: 16px; }
.benefit-card .title { font-size: 13px; font-weight: 700; color: var(--text-strong); }
.benefit-card .desc { font-size: 11px; color: var(--text-muted); }
.form-group { margin-bottom: 18px; }
.form-label { display: block; font-size: 12px; font-weight: 600; color: var(--text-muted); margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.5px; }
@keyframes spin { to { transform: rotate(360deg); } }
.spin { animation: spin 1.4s linear infinite; }

/* === Print === */
@media print { .app-header { display: none !important; } body { background: #fff !important; color: #000 !important; } }



/* ==========================================================================
   PAYMENT SUCCESS PAGE
   (Previously inlined in <style> inside payment-success.html — but the page
   uses th:replace="~{layout :: html}" which drops the page's <head>, so
   those inline styles never reached the browser. Hoisted here so they
   apply globally and the success page actually renders.)
   ========================================================================== */

.success-page-wrapper {
    width: 100%;
    max-width: 520px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: stretch;
}
@media (max-width: 767px) {
    .success-page-wrapper {
        max-width: 100%;
        padding: 0 16px;
        box-sizing: border-box;
        gap: 16px;
    }
}

/* Legacy wrappers (no longer used by the redesigned single-column layout
   but kept here so previously-rendered HTML doesn't break if cached). */
.success-grid-container, .column-left, .column-right, .success-bottom-section {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Success Hero */
.success-hero-section {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}
.success-icon-wrapper {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: rgba(16, 185, 129, 0.1);
    border: 2px solid var(--success);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--success);
    box-shadow: 0 0 24px rgba(16, 185, 129, 0.25);
    margin-bottom: 8px;
}
.success-icon-wrapper i { width: 40px; height: 40px; }
.success-hero-title {
    font-family: 'Outfit', sans-serif;
    font-size: 26px;
    font-weight: 700;
    color: var(--text-strong);
    margin: 0;
    letter-spacing: -0.5px;
}
.success-hero-subtext {
    font-size: 14px;
    color: var(--text-muted);
    margin: 0;
}



/* Elevated card surface used by every success-page section */
.elevated-success-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: 24px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    width: 100%;
}

/* Savings summary (You Paid / You Saved) */
.savings-summary-card {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    border: 1.5px solid rgba(16, 185, 129, 0.25);
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.10) 0%, rgba(139, 92, 246, 0.06) 100%);
    box-shadow: 0 14px 40px rgba(16, 185, 129, 0.12), 0 10px 30px rgba(0, 0, 0, 0.2);
}
.savings-row {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: space-around;
    gap: 8px;
}
.savings-divider {
    width: 1px;
    align-self: stretch;
    background: linear-gradient(to bottom, transparent, rgba(255,255,255,0.10), transparent);
    flex-shrink: 0;
}
.savings-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    flex: 1;
    min-width: 0;
}
.savings-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    font-weight: 600;
}
.savings-paid-value {
    font-family: 'Outfit', sans-serif;
    font-size: clamp(28px, 6vw, 36px);
    font-weight: 800;
    color: var(--text-strong);
    line-height: 1.1;
    letter-spacing: -0.5px;
}
.savings-saved-value {
    font-family: 'Outfit', sans-serif;
    font-size: clamp(28px, 6vw, 36px);
    font-weight: 800;
    color: var(--success);
    line-height: 1.1;
    letter-spacing: -0.5px;
}
.savings-celebration-banner {
    background: rgba(16, 185, 129, 0.08);
    border: 1px dashed rgba(16, 185, 129, 0.3);
    border-radius: 12px;
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 600;
    color: var(--success);
    width: 100%;
    box-sizing: border-box;
}

/* Merchant info card */
.merchant-info-card { display: flex; flex-direction: column; gap: 16px; }
.merchant-name-row {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 700;
    color: var(--text-strong);
}
.merchant-icon { font-size: 20px; }
.merchant-payment-source {
    border-top: 1px solid var(--card-border);
    padding-top: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.payment-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}
.payment-method-detail { display: flex; align-items: center; gap: 12px; }
.payment-icon-box {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--card-border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    flex-shrink: 0;
}
.payment-icon-box i { width: 18px; height: 18px; }
.payment-text-box { display: flex; flex-direction: column; }
.payment-method-name { font-weight: 600; font-size: 14px; color: var(--text-strong); }
.payment-reference { font-size: 12px; color: var(--text-muted); margin-top: 2px; }



/* Payment Summary breakdown card (right column) */
.payment-summary-title {
    font-family: 'Outfit', sans-serif;
    font-size: 14px;
    font-weight: 700;
    color: var(--primary);
    margin: 0 0 4px 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.amount-breakdown-card { display: flex; flex-direction: column; gap: 14px; }
.breakdown-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
}
.breakdown-row .label { color: var(--text-muted); }
.breakdown-row .value { color: var(--text-strong); font-weight: 500; }
.breakdown-row .success-text { color: var(--success); font-weight: 600; }
.breakdown-divider {
    border: 0;
    border-top: 1px solid var(--card-border);
    margin: 4px 0;
}
.breakdown-row.total-row { font-size: 16px; font-weight: 700; }
.breakdown-row.total-row .label { color: var(--text-strong); }
.breakdown-row.total-row .value.highlight {
    font-size: 20px;
    color: var(--text-strong);
    font-weight: 800;
    font-family: 'Outfit', sans-serif;
}

/* Action buttons */
.actions-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
    margin-top: 8px;
}
.secondary-actions-row { display: flex; gap: 12px; width: 100%; }
@media (max-width: 767px) {
    .secondary-actions-row { flex-direction: column; gap: 12px; }
}
.btn-receipt {
    flex: 1;
    min-height: 48px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: var(--transition);
    cursor: pointer;
    text-decoration: none;
    box-sizing: border-box;
}
.btn-receipt-download {
    background: rgba(139, 92, 246, 0.1);
    border: 1px solid rgba(139, 92, 246, 0.3);
    color: var(--primary);
}
.btn-receipt-download:hover { background: rgba(139, 92, 246, 0.2); color: var(--text-strong); }
.btn-receipt-share {
    background: rgba(236, 72, 153, 0.1);
    border: 1px solid rgba(236, 72, 153, 0.3);
    color: var(--secondary);
}
.btn-receipt-share:hover { background: rgba(236, 72, 153, 0.2); color: var(--text-strong); }
.btn-primary-cta {
    background: var(--accent);
    border: 0;
    color: #000;
    font-family: 'Outfit', sans-serif;
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;
    min-height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 18px var(--accent-glow);
    transition: var(--transition);
    cursor: pointer;
    width: 100%;
    box-sizing: border-box;
}
.btn-primary-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 22px var(--accent-glow);
    filter: brightness(1.1);
}



/* Collapsible Transaction Details accordion */
.transaction-details-accordion {
    width: 100%;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    overflow: hidden;
    box-sizing: border-box;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}
.accordion-toggle {
    width: 100%;
    background: transparent;
    border: 0;
    padding: 16px 20px;
    text-align: left;
    cursor: pointer;
    font-family: 'Outfit', sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition);
}
.accordion-toggle:hover { color: var(--text-strong); background: rgba(255, 255, 255, 0.02); }
.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    background: rgba(0, 0, 0, 0.1);
}
.accordion-content.expanded {
    max-height: 600px;
    transition: max-height 0.3s ease-in;
}
.accordion-inner {
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    border-top: 1px solid var(--card-border);
}
.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    flex-wrap: wrap;
}
.detail-row .label { color: var(--text-muted); flex-shrink: 0; }
.detail-row .value {
    color: var(--text-strong);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    flex: 1;
    justify-content: flex-end;
}
.copy-icon-btn {
    border: 0;
    background: transparent;
    padding: 4px;
    cursor: pointer;
    color: var(--primary);
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    flex-shrink: 0;
}
.copy-icon-btn:hover { background: rgba(139, 92, 246, 0.1); color: var(--secondary); }
.copy-icon-btn i { width: 14px; height: 14px; }
.val-text {
    font-size: 13px;
    color: var(--text-strong);
    word-break: break-all;
    text-align: right;
}

/* Generic non-success status card (pending / failed) */
.generic-status-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: 40px 24px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    text-align: center;
    max-width: 440px;
    width: 100%;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}
.status-icon-box {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 4px;
}
.status-icon-box i { width: 36px; height: 36px; }

.support-footer {
    text-align: center;
    border-top: 1px solid var(--card-border);
    padding-top: 18px;
    width: 100%;
    font-size: 12px;
    color: var(--text-faint);
    display: flex;
    flex-direction: column;
    gap: 4px;
}



/* ============================================================================
   Profile-and-Nav redesign (2026-06)
   ----------------------------------------------------------------------------
   Adds the new components introduced by the IA cleanup:
     - Header actions cluster (notifications + avatar dropdown) — desktop only.
     - Avatar dropdown menu.
     - Profile hero (avatar / name / phone) and Lifetime Savings card.
     - Refreshed Profile menu links with title + sub-text.
     - Transaction (.txn-card) layout: shop / paid / saved / date • time.
     - Page-title / page-subtitle / summary-row helpers reused across
       Transactions, Cashback, Settings and Help & Support pages.
     - .stat-pill--accent variant for the Saved chip on Transactions.
     - .stub-state helper for the Coming-soon pages.
   These styles APPEND on top of the existing stylesheet and intentionally
   override or complement, but never delete, prior selectors so existing
   pages (login, payment-success, shop sheet, etc.) keep rendering as-is.
   ============================================================================ */

/* === Header actions cluster (notifications + avatar dropdown) =============== */
.header-actions { display: flex; align-items: center; gap: 8px; }

/* Mobile-only Profile icon (person glyph -> /profile). Hidden on desktop, which
   uses the avatar dropdown instead. */
.header-profile-link { display: none; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 50%; color: var(--text-strong); }
.header-profile-link:hover { background: rgba(0,0,0,0.05); color: var(--primary); }
.header-profile-link :is(i, svg) { width: 24px; height: 24px; stroke-width: 2; }

/* Header back button — revealed by JS on non-home pages (top-left). */
.header-back { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 50%; color: var(--text-strong); flex-shrink: 0; }
.header-back[hidden] { display: none; }
.header-back:hover { background: rgba(0,0,0,0.05); color: var(--primary); }
.header-back :is(i, svg) { width: 22px; height: 22px; }

@media (max-width: 767px) {
    /* Mobile: top-right shows a plain Profile icon (-> /profile), not the avatar
       photo. Hide the bell and the avatar dropdown; show the profile icon. */
    .header-actions .header-icon-btn { display: none; }
    .avatar-menu { display: none; }
    .header-profile-link { display: inline-flex; }
}

.header-icon-btn {
    width: 40px; height: 40px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--card-border);
    color: var(--text-muted);
    transition: var(--transition);
    cursor: pointer;
}
.header-icon-btn:hover { color: var(--text-strong); background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.12); }
.header-icon-btn :is(i, svg) { width: 18px; height: 18px; }

/* === Avatar trigger + dropdown ============================================= */
.avatar-menu { position: relative; }
.avatar-trigger {
    display: flex; align-items: center; gap: 6px;
    padding: 4px 8px 4px 4px;
    border-radius: var(--radius-full, 999px);
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--card-border);
    color: var(--text-muted);
    transition: var(--transition);
    cursor: pointer;
    min-height: 40px;
}
.avatar-trigger:hover { background: rgba(255,255,255,0.08); color: var(--text-strong); }
.avatar-trigger .header-avatar {
    width: 30px; height: 30px;
    border: 1.5px solid var(--primary);
}
.avatar-trigger__chev { width: 14px; height: 14px; }

.avatar-dropdown {
    position: absolute; top: calc(100% + 8px); right: 0;
    min-width: 280px;
    background: rgba(11,6,32,0.97);
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    box-shadow: 0 16px 40px rgba(0,0,0,0.45);
    padding: 8px;
    z-index: 60;
    animation: fadeIn 0.18s ease;
}
.avatar-dropdown[hidden] { display: none; }

.avatar-dropdown__head {
    padding: 10px 12px 12px;
    border-bottom: 1px solid var(--card-border);
    margin-bottom: 6px;
}
.avatar-dropdown__name { font-size: 15px; font-weight: 700; color: var(--text-strong); line-height: 1.2; }
.avatar-dropdown__phone { font-size: 12px; color: var(--text-muted); margin-top: 4px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

.avatar-dropdown a {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    color: var(--text);
    font-size: 14px; font-weight: 500;
    transition: var(--transition);
    text-decoration: none;
}
.avatar-dropdown a:hover { background: rgba(255,255,255,0.04); color: var(--text-strong); }
.avatar-dropdown a :is(i, svg) { width: 16px; height: 16px; color: var(--text-muted); }
.avatar-dropdown a:hover :is(i, svg) { color: var(--primary); }
.avatar-dropdown a.is-danger { color: #f87171; }
.avatar-dropdown a.is-danger :is(i, svg) { color: #f87171; }
.avatar-dropdown a.is-danger:hover { background: rgba(239,68,68,0.10); color: #fca5a5; }

.avatar-dropdown__sep {
    height: 1px; background: var(--card-border);
    margin: 6px 8px;
}

/* === Page-level helpers (used by Transactions / stub pages) ================= */
.page-title { font-family: 'Outfit', sans-serif; font-size: 28px; font-weight: 800; letter-spacing: -0.4px; margin: 4px 0 6px; }
@media (min-width: 768px) { .page-title { font-size: 32px; } }
.page-subtitle { color: var(--text-muted); font-size: 14px; margin: 0 0 24px; }

.summary-row { display: flex; gap: 12px; margin-bottom: 24px; flex-wrap: wrap; }

/* Slight upgrade to existing .stat-pill so values + labels stack readably. */
.stat-pill { gap: 8px; padding: 10px 18px; min-height: 44px; }
.stat-pill .label { font-size: 12px; color: var(--text-muted); font-weight: 600; }
.stat-pill--accent { background: var(--accent-soft); border-color: rgba(245,158,11,0.3); }
.stat-pill--accent .label { color: var(--text-muted); }
.stat-pill--accent .value { color: var(--accent); }

/* === Profile hero + Lifetime Savings card ================================== */
.profile-page { max-width: 540px; margin-left: auto; margin-right: auto; }

.profile-hero {
    display: flex; flex-direction: column; align-items: center;
    gap: 10px;
    padding: 24px 0 8px;
    text-align: center;
}
.profile-hero__avatar {
    width: 88px; height: 88px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid var(--primary);
    box-shadow: 0 0 0 4px var(--primary-soft, rgba(139,92,246,0.10));
}
.profile-hero__avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile-hero__name { font-family: 'Outfit', sans-serif; font-size: 22px; font-weight: 800; color: var(--text-strong); margin: 8px 0 0; letter-spacing: -0.3px; }
.profile-hero__phone { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; color: var(--text-muted); margin: 0; }

.savings-card {
    margin: 24px 0;
    padding: 20px;
    background: linear-gradient(135deg, rgba(16,185,129,0.10), rgba(139,92,246,0.06));
    border: 1px solid rgba(16,185,129,0.25);
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.20);
}
.savings-card__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.savings-card__label { font-size: 13px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.6px; }
.savings-card__icon {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: var(--success-soft);
    display: flex; align-items: center; justify-content: center;
    color: var(--success);
}
.savings-card__icon :is(i, svg) { width: 16px; height: 16px; }
.savings-card__amount { font-family: 'Outfit', sans-serif; font-size: 36px; font-weight: 800; color: var(--success); letter-spacing: -0.6px; line-height: 1.05; }
.savings-card__hint { font-size: 12px; color: var(--text-muted); margin-top: 6px; }

/* === Refreshed Profile menu (title + sub) ================================== */
.profile-menu { gap: 12px; margin-top: 8px; max-width: none; }
.profile-link {
    align-items: center;
    padding: 14px 16px;
    border-radius: 16px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    transition: var(--transition);
    min-height: 64px;
    text-decoration: none;
    color: var(--text);
}
.profile-link__icon {
    width: 40px; height: 40px;
    border-radius: 12px;
    background: var(--primary-soft);
    display: flex; align-items: center; justify-content: center;
    color: var(--primary);
    flex-shrink: 0;
}
.profile-link__icon :is(i, svg) { width: 18px; height: 18px; color: var(--primary); }
.profile-link__text { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.profile-link__title { font-size: 15px; font-weight: 600; color: var(--text-strong); }
.profile-link__sub { font-size: 12px; color: var(--text-muted); }
.profile-link__arrow { width: 16px; height: 16px; color: var(--text-faint); flex-shrink: 0; }

.profile-link.is-danger .profile-link__icon { background: rgba(239,68,68,0.12); color: #f87171; }
.profile-link.is-danger .profile-link__icon :is(i, svg) { color: #f87171; }
.profile-link.is-danger .profile-link__title { color: #fca5a5; }
.profile-link.is-danger:hover { border-color: rgba(239,68,68,0.30); }

/* === Transactions list (.txn-card) ========================================== */
.txn-list { display: flex; flex-direction: column; gap: 12px; }

.txn-card {
    display: flex; align-items: center; gap: 14px;
    padding: 16px;
    border-radius: 16px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    color: var(--text);
    text-decoration: none;
    transition: var(--transition);
    min-width: 0;
}
.txn-card:hover { border-color: rgba(139,92,246,0.30); transform: translateY(-1px); box-shadow: 0 12px 28px rgba(0,0,0,0.30); }

.txn-card__icon {
    width: 44px; height: 44px;
    border-radius: 12px;
    background: var(--primary-soft);
    display: flex; align-items: center; justify-content: center;
    color: var(--primary);
    flex-shrink: 0;
}
.txn-card__icon :is(i, svg) { width: 20px; height: 20px; }

.txn-card__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.txn-card__shop { font-size: 15px; font-weight: 700; color: var(--text-strong); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.txn-card__amount-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.txn-card__paid { font-family: 'Outfit', sans-serif; font-size: 16px; font-weight: 800; color: var(--text-strong); letter-spacing: -0.2px; }
.txn-card__saved { font-size: 13px; font-weight: 700; color: var(--success); }
.txn-card__meta { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.txn-card__chev { width: 18px; height: 18px; color: var(--text-faint); flex-shrink: 0; }

/* === Stub pages (Cashback / Settings / Help) ================================ */
.stub-state { padding: 56px 16px; }
.stub-state .icon { width: 80px; height: 80px; }
.stub-state .icon :is(i, svg) { width: 36px; height: 36px; }
.stub-state h3 { font-size: 20px; }
.stub-state p { font-size: 14px; max-width: 420px; }

/* === Transaction history: filter tabs + status-aware card variants === */
.history-filters {
    display: flex;
    gap: 8px;
    margin: 14px 0 18px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
    scrollbar-width: none;
}
.history-filters::-webkit-scrollbar { display: none; }

.history-filter {
    flex-shrink: 0;
    padding: 8px 14px;
    border-radius: var(--radius-full);
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    line-height: 1;
}
.history-filter i { width: 14px; height: 14px; }
.history-filter:hover { color: var(--text-strong); border-color: rgba(139, 92, 246, 0.4); }
.history-filter--active {
    background: rgba(139, 92, 246, 0.18);
    border-color: var(--primary);
    color: var(--text-strong);
}
.history-filter .count { font-size: 11px; opacity: 0.7; font-weight: 700; }
.history-filter--active .count { opacity: 1; }

/* Shop name + status pill on the same row */
.txn-card__shop-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
}
.txn-card__status-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: var(--radius-full);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.txn-card__status-pill--pending {
    background: var(--accent-soft);
    color: var(--accent);
    border: 1px solid rgba(245, 158, 11, 0.35);
}
.txn-card__status-pill--failed {
    background: var(--error-soft);
    color: var(--error);
    border: 1px solid rgba(239, 68, 68, 0.35);
}

/* Status-tinted card icons for non-success rows */
.txn-card[data-status-bucket="pending"] .txn-card__icon {
    background: var(--accent-soft);
    color: var(--accent);
}
.txn-card[data-status-bucket="failed"] .txn-card__icon {
    background: var(--error-soft);
    color: var(--error);
}

/* Amount label colour overrides for non-success rows */
.txn-card__paid--pending { color: var(--accent) !important; }
.txn-card__paid--failed  { color: var(--error)  !important; }


/* ==========================================================================
   LIGHT THEME — html[data-theme="light"]
   Dark is the default. This section is purely ADDITIVE: it overrides the
   design tokens for light mode and patches the hardcoded dark panels,
   inputs and translucent-white surfaces that don't flip via tokens alone.
   White text now uses --text-strong, so text colour flips automatically.
   Brand gradients (buttons, badges) are intentionally identical in both.
   ========================================================================== */
html[data-theme="light"] {
    color-scheme: light;

    --bg-gradient: linear-gradient(135deg, #f5f5fb 0%, #eceef6 50%, #f6f5fb 100%);
    --bg-app: #f3f3f9;
    --bg: #f3f3f9;
    --bg-elevated: #ffffff;
    --surface-1: #ffffff;
    --surface-2: #ffffff;
    --surface-3: rgba(17, 17, 40, 0.02);
    --surface: #ffffff;
    --surface-hover: #eef0f6;
    --card-bg: #ffffff;
    --card-border: rgba(17, 17, 40, 0.10);
    --card-border-strong: rgba(17, 17, 40, 0.16);
    --divider: rgba(17, 17, 40, 0.08);

    --text-main: #2c2c3f;
    --text: #2c2c3f;
    --text-strong: #14142b;
    --text-muted: #56566b;
    --text-faint: #9595aa;

    --shadow-sm: 0 2px 8px rgba(17, 17, 40, 0.06);
    --shadow-md: 0 8px 24px rgba(17, 17, 40, 0.10);
    --shadow-lg: 0 16px 40px rgba(17, 17, 40, 0.14);
}

/* Chrome (sticky header, bottom nav, auth nav): dark glass -> light glass */
html[data-theme="light"] .app-header { background: rgba(255, 255, 255, 0.85); }
html[data-theme="light"] .auth-nav { background: rgba(255, 255, 255, 0.70); }

/* Dark popovers / cards -> light */
html[data-theme="light"] .loc-dropdown,
html[data-theme="light"] .avatar-dropdown { background: rgba(255, 255, 255, 0.98); box-shadow: 0 16px 40px rgba(17, 17, 40, 0.18); }
html[data-theme="light"] .auth-card { background: rgba(255, 255, 255, 0.86); box-shadow: 0 24px 60px rgba(17, 17, 40, 0.18); }

/* Inputs: flip dark/translucent fills to solid light with a visible border */
html[data-theme="light"] .app-header .header-search input,
html[data-theme="light"] .mobile-search input,
html[data-theme="light"] .bill-input-wrap input,
html[data-theme="light"] .loc-search-box input,
html[data-theme="light"] .auth-input,
html[data-theme="light"] .otp-box {
    background: #ffffff;
    border-color: var(--card-border);
}
html[data-theme="light"] .otp-box.is-filled { background: rgba(139, 92, 246, 0.06); }

/* Translucent-white surfaces -> subtle dark tints so they read on a light bg */
html[data-theme="light"] .btn-secondary,
html[data-theme="light"] .header-icon-btn,
html[data-theme="light"] .avatar-trigger,
html[data-theme="light"] .loc-chip,
html[data-theme="light"] .cat-chip,
html[data-theme="light"] .payment-icon-box,
html[data-theme="light"] .trust-metrics,
html[data-theme="light"] .benefit-card,
html[data-theme="light"] .auth-pill-back { background: rgba(17, 17, 40, 0.03); border-color: var(--card-border); }

html[data-theme="light"] .btn-secondary:hover,
html[data-theme="light"] .header-link:hover,
html[data-theme="light"] .header-icon-btn:hover,
html[data-theme="light"] .avatar-trigger:hover,
html[data-theme="light"] .cat-chip:hover,
html[data-theme="light"] .profile-link:hover,
html[data-theme="light"] .avatar-dropdown a:hover,
html[data-theme="light"] .accordion-toggle:hover { background: rgba(17, 17, 40, 0.05); }

/* Shop bottom sheet / drawer */
html[data-theme="light"] .shop-sheet .overlay { background: rgba(17, 17, 40, 0.35); }
html[data-theme="light"] .shop-sheet .handle { background: rgba(17, 17, 40, 0.18); }
html[data-theme="light"] .shop-sheet .close-btn { background: rgba(17, 17, 40, 0.06); }
html[data-theme="light"] .shop-sheet .close-btn:hover { background: rgba(17, 17, 40, 0.10); }

/* Accordion (payment-success details) dark fill -> light */
html[data-theme="light"] .accordion-content { background: rgba(17, 17, 40, 0.02); }

/* === Theme toggle button (header) ========================================= */
.theme-toggle { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 50%; background: rgba(255, 255, 255, 0.04); border: 1px solid var(--card-border); color: var(--text-muted); cursor: pointer; transition: var(--transition); flex-shrink: 0; }
.theme-toggle:hover { color: var(--text-strong); border-color: var(--primary); }
.theme-toggle :is(i, svg) { width: 18px; height: 18px; }
html[data-theme="light"] .theme-toggle { background: rgba(17, 17, 40, 0.04); }
.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: inline-block; }
html[data-theme="light"] .theme-toggle .icon-sun { display: inline-block; }
html[data-theme="light"] .theme-toggle .icon-moon { display: none; }

/* --- Light-mode contrast fixes --- */
/* The active category chip must keep its brand gradient + white text; the
   generic .cat-chip light override above is more specific than .cat-chip.is-active. */
html[data-theme="light"] .cat-chip.is-active { background: linear-gradient(135deg, var(--primary), var(--secondary)); border-color: transparent; color: #fff; }
/* Sandbox OTP toast: darken the amber text so it reads on the light amber wash. */
html[data-theme="light"] .otp-sim-toast { color: #92400e; border-color: rgba(180, 83, 9, 0.35); }
html[data-theme="light"] .otp-sim-toast .label { color: #b45309; }
/* Amber accent TEXT on amber-tinted surfaces is low-contrast in light mode;
   darken it (the bright --accent is kept for icons/borders/backgrounds). */
html[data-theme="light"] .cashback-highlight .text,
html[data-theme="light"] .stat-pill--accent .value,
html[data-theme="light"] .txn-card__status-pill--pending,
html[data-theme="light"] .txn-card__paid--pending { color: #b45309 !important; }

/* ==========================================================================
   sec 6.3c — Tactile press feedback
   Interactive elements dip slightly on press. Placed at end-of-file so this
   :active rule wins over earlier :hover transforms at equal specificity, and
   animates via each element's existing `transition: var(--transition)`.
   Skipped for users who prefer reduced motion.
   ========================================================================== */
@media (prefers-reduced-motion: no-preference) {
    .btn:active,
    .pay-btn:active,
    .shop-card:active,
    .cat-chip:active,
    .profile-link:active {
        transform: scale(0.98);
    }
}


/* ============================================================
   Accessibility utilities — UI Optimization Plan, Phase 2
   Additive only: skip link, screen-reader-only text, and a
   consistent keyboard focus ring. Plain CSS (no Tailwind).
   ============================================================ */

/* Visually hidden, but still exposed to assistive technology. */
.sr-only {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Skip-to-content link: off-screen until keyboard-focused, then pinned
   top-left so keyboard / screen-reader users can jump past the chrome. */
.skip-link {
    position: absolute;
    left: 8px;
    top: -56px;
    z-index: 1000;
    padding: 10px 16px;
    background: var(--accent, #f59e0b);
    color: #000;
    font-weight: 700;
    font-size: 14px;
    line-height: 1;
    border-radius: 8px;
    text-decoration: none;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
    transition: top 0.15s ease;
}
.skip-link:focus {
    top: 8px;
    outline: 2px solid #000;
    outline-offset: 2px;
}

/* Consistent, visible keyboard focus ring (WCAG 2.4.7). Shows only for
   keyboard / AT focus via :focus-visible, never on a plain mouse click. */
:focus-visible {
    outline: 2px solid var(--accent, #f59e0b);
    outline-offset: 2px;
}
:focus:not(:focus-visible) {
    outline: none;
}

/* === Profile sub-pages: Edit Profile + Notifications ======================= */
.profile-alert { margin: 0 0 16px; border-radius: 12px; padding: 12px 14px; font-size: 14px; font-weight: 600; }
.profile-alert--ok { background: var(--success-soft, rgba(16,185,129,0.12)); border: 1px solid rgba(16,185,129,0.35); color: var(--success, #059669); }
.profile-alert--err { background: rgba(239,68,68,0.10); border: 1px solid rgba(239,68,68,0.35); color: #dc2626; }

/* Avatar upload control (camera badge over the avatar) */
.avatar-uploader { position: relative; display: inline-block; }
.avatar-uploader__btn { position: absolute; right: -2px; bottom: -2px; width: 34px; height: 34px; border-radius: 50%;
    border: 3px solid var(--card-bg); background: linear-gradient(135deg, var(--accent), var(--secondary)); color: #000;
    display: flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; box-shadow: 0 2px 6px rgba(0,0,0,0.25); }
.avatar-uploader__btn :is(i, svg) { width: 16px; height: 16px; }

/* Edit Profile: photo row + form fields */
.edit-photo-row { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; }
.edit-photo-row__title { font-size: 15px; font-weight: 600; color: var(--text-strong); }
.edit-photo-row__sub { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.edit-form { max-width: 480px; }
.pf-field { margin-bottom: 16px; }
.pf-label { display: block; font-size: 13px; font-weight: 600; color: var(--text-muted); margin-bottom: 6px; }
.pf-input { width: 100%; box-sizing: border-box; padding: 12px 14px; border: 1px solid var(--card-border); border-radius: 12px;
    font-size: 15px; color: var(--text-strong); background: var(--card-bg); transition: var(--transition); }
.pf-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-glow); }
.pf-input--locked { background: var(--primary-soft, rgba(125,125,135,0.10)); color: var(--text-muted); cursor: not-allowed; }
.pf-prefix { display: flex; align-items: stretch; }
.pf-prefix > span { display: inline-flex; align-items: center; padding: 0 12px; border: 1px solid var(--card-border); border-right: none;
    border-radius: 12px 0 0 12px; background: var(--primary-soft, rgba(125,125,135,0.10)); color: var(--text-muted); font-size: 15px; }
.pf-prefix .pf-input { border-radius: 0 12px 12px 0; }
.pf-help { font-size: 12px; color: var(--text-muted); margin-top: 6px; }
.pf-error { display: block; color: #dc2626; font-size: 12px; margin-top: 6px; }
.pf-actions { margin-top: 20px; display: flex; gap: 12px; justify-content: flex-end; flex-wrap: wrap; }

/* Notification toggle rows (match the .profile-link card style) */
.notif-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 16px;
    border-radius: 16px; background: var(--card-bg); border: 1px solid var(--card-border); }
.notif-row + .notif-row { margin-top: 12px; }
.notif-row__title { font-size: 15px; font-weight: 600; color: var(--text-strong); }
.notif-row__sub { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.notif-switch { position: relative; display: inline-block; width: 48px; height: 28px; flex: 0 0 auto; }
.notif-switch input { opacity: 0; width: 0; height: 0; }
.notif-switch__slider { position: absolute; cursor: pointer; inset: 0; background: var(--card-border); border-radius: 999px; transition: 0.2s; }
.notif-switch__slider::before { content: ""; position: absolute; height: 22px; width: 22px; left: 3px; top: 3px;
    background: #fff; border-radius: 50%; transition: 0.2s; box-shadow: 0 1px 3px rgba(0,0,0,0.25); }
.notif-switch input:checked + .notif-switch__slider { background: linear-gradient(135deg, var(--primary), var(--secondary)); }
.notif-switch input:checked + .notif-switch__slider::before { transform: translateX(20px); }
