/* =============================================================
   DataConnekt — Base + Components
   Depends on tokens.css. Never hardcode a colour in this file.
   ============================================================= */

/* ── Reset ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    font-size: var(--fs-base);
    line-height: var(--lh-normal);
    -webkit-font-smoothing: antialiased;
    transition: background var(--t), color var(--t);
    min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 700;
    line-height: var(--lh-tight);
    letter-spacing: -0.02em;
    color: var(--text);
}

a { color: var(--cyan); text-decoration: none; transition: color var(--t-fast); }
a:hover { color: var(--cyan-bright); }

img, svg { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, select, textarea { font-family: inherit; font-size: inherit; }
ul, ol { list-style: none; }

:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; border-radius: 4px; }

/* Numbers use the mono face — balances, stats, references, PINs. */
.num, .mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }

/* ── Utilities ──────────────────────────────────────────────── */
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--sp-5); }
.stack     { display: flex; flex-direction: column; }
.row       { display: flex; align-items: center; }
.between   { display: flex; align-items: center; justify-content: space-between; }
.center    { display: flex; align-items: center; justify-content: center; }
.wrap      { flex-wrap: wrap; }
.grow      { flex: 1; }
.gap-1{gap:var(--sp-1)} .gap-2{gap:var(--sp-2)} .gap-3{gap:var(--sp-3)}
.gap-4{gap:var(--sp-4)} .gap-5{gap:var(--sp-5)} .gap-6{gap:var(--sp-6)}
.mt-2{margin-top:var(--sp-2)} .mt-3{margin-top:var(--sp-3)} .mt-4{margin-top:var(--sp-4)}
.mt-5{margin-top:var(--sp-5)} .mt-6{margin-top:var(--sp-6)}
.mb-2{margin-bottom:var(--sp-2)} .mb-3{margin-bottom:var(--sp-3)} .mb-4{margin-bottom:var(--sp-4)}
.mb-5{margin-bottom:var(--sp-5)} .mb-6{margin-bottom:var(--sp-6)}
.text-center{text-align:center} .text-right{text-align:right}
.text-soft{color:var(--text-soft)} .text-muted{color:var(--text-muted)}
.text-cyan{color:var(--cyan)} .text-gold{color:var(--gold)}
.text-success{color:var(--success)} .text-danger{color:var(--danger)} .text-warning{color:var(--warning)}
.fs-xs{font-size:var(--fs-xs)} .fs-sm{font-size:var(--fs-sm)} .fs-lg{font-size:var(--fs-lg)}
.fw-500{font-weight:500} .fw-600{font-weight:600} .fw-700{font-weight:700}
.hide { display: none !important; }
.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0;
    overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ── Section heading ────────────────────────────────────────── */
.eyebrow {
    display: inline-flex; align-items: center; gap: var(--sp-2);
    font-family: var(--font-mono); font-size: var(--fs-xs);
    text-transform: uppercase; letter-spacing: 0.14em;
    color: var(--cyan); margin-bottom: var(--sp-3);
}
.eyebrow::before {
    content: ''; width: 22px; height: 2px;
    background: var(--cyan); border-radius: 2px;
}

.section-head { margin-bottom: var(--sp-6); }
.section-head h2 { font-size: var(--fs-2xl); margin-bottom: var(--sp-3); }
.section-head p  { color: var(--text-soft); max-width: 58ch; }

/* ── Buttons ────────────────────────────────────────────────── */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    gap: var(--sp-2);
    padding: 0.75rem 1.375rem;
    border-radius: var(--r);
    font-family: var(--font-body);
    font-size: var(--fs-base);
    font-weight: 600;
    white-space: nowrap;
    transition: transform var(--t-fast), filter var(--t-fast),
                background var(--t-fast), box-shadow var(--t-fast);
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }

.btn-gold {
    background: var(--grad-gold);
    color: var(--ink);
    box-shadow: var(--shadow-gold);
}
.btn-gold:hover:not(:disabled) { filter: brightness(1.07); color: var(--ink); }

.btn-cyan {
    background: var(--grad-cyan);
    color: var(--ink);
    box-shadow: var(--shadow-cyan);
}
.btn-cyan:hover:not(:disabled) { filter: brightness(1.07); color: var(--ink); }

.btn-ghost {
    background: transparent;
    border: 1.5px solid var(--line-strong);
    color: var(--text);
}
.btn-ghost:hover:not(:disabled) { border-color: var(--cyan); color: var(--cyan); }

.btn-soft {
    background: var(--surface-2);
    border: 1px solid var(--line);
    color: var(--text);
}
.btn-soft:hover:not(:disabled) { background: var(--surface-hover); }

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover:not(:disabled) { filter: brightness(1.08); color: #fff; }

.btn-block { width: 100%; }
.btn-lg { padding: 0.95rem 1.75rem; font-size: var(--fs-md); }
.btn-sm { padding: 0.5rem 0.875rem; font-size: var(--fs-sm); border-radius: var(--r-sm); }

/* ── Cards ──────────────────────────────────────────────────── */
.card {
    background: var(--grad-card);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    padding: var(--sp-5);
    box-shadow: var(--shadow-sm);
}
.card-flat { background: var(--surface); box-shadow: none; }
.card-head {
    display: flex; align-items: center; justify-content: space-between;
    gap: var(--sp-3); margin-bottom: var(--sp-4);
    padding-bottom: var(--sp-4); border-bottom: 1px solid var(--line-soft);
}
.card-head h3 { font-size: var(--fs-md); }

/* Glow rim used on hero/primary cards */
.card-glow { position: relative; overflow: hidden; }
.card-glow::before {
    content: ''; position: absolute; inset: 0;
    padding: 1px; border-radius: inherit;
    background: linear-gradient(140deg, var(--cyan-glow), transparent 42%, var(--gold-glow));
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor; mask-composite: exclude;
    pointer-events: none;
}

/* ── Badges & pills ─────────────────────────────────────────── */
.badge {
    display: inline-flex; align-items: center; gap: 0.375rem;
    padding: 0.25rem 0.625rem;
    border-radius: var(--r-full);
    font-size: var(--fs-xs); font-weight: 600;
    line-height: 1.5;
}
.badge-success { background: var(--success-faint); color: var(--success); }
.badge-warning { background: var(--warning-faint); color: var(--warning); }
.badge-danger  { background: var(--danger-faint);  color: var(--danger);  }
.badge-info    { background: var(--info-faint);    color: var(--info);    }
.badge-muted   { background: var(--surface-2); color: var(--text-soft); }
.badge-gold    { background: var(--gold-faint); color: var(--gold); }

.badge-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* ── Forms ──────────────────────────────────────────────────── */
.field { margin-bottom: var(--sp-4); }
.label {
    display: block; margin-bottom: var(--sp-2);
    font-size: var(--fs-sm); font-weight: 600; color: var(--text-soft);
}
.label .req { color: var(--danger); }

.input, .select, .textarea {
    width: 100%;
    padding: 0.8125rem 1rem;
    background: var(--bg-alt);
    border: 1.5px solid var(--line);
    border-radius: var(--r);
    color: var(--text);
    transition: border-color var(--t-fast), box-shadow var(--t-fast), background var(--t-fast);
}
.input::placeholder, .textarea::placeholder { color: var(--text-muted); }
.input:focus, .select:focus, .textarea:focus {
    outline: none;
    border-color: var(--cyan);
    box-shadow: 0 0 0 4px var(--cyan-faint);
}
.input:disabled, .select:disabled { opacity: 0.6; cursor: not-allowed; }
.textarea { min-height: 120px; resize: vertical; line-height: var(--lh-normal); }

.select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%239FB0C9' stroke-width='2.5' stroke-linecap='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

.input-money { font-family: var(--font-mono); font-size: var(--fs-lg); font-weight: 600; }

.input-group { position: relative; }
.input-group .input { padding-left: 2.75rem; }
.input-group .input-icon {
    position: absolute; left: 1rem; top: 50%; transform: translateY(-50%);
    color: var(--text-muted); pointer-events: none; font-size: var(--fs-sm);
}
.input-group .input-suffix {
    position: absolute; right: 0.5rem; top: 50%; transform: translateY(-50%);
}

.hint { margin-top: var(--sp-2); font-size: var(--fs-xs); color: var(--text-muted); }
.error-text { margin-top: var(--sp-2); font-size: var(--fs-xs); color: var(--danger); }
.field.has-error .input, .field.has-error .select { border-color: var(--danger); }

/* Checkbox / radio */
.check { display: flex; align-items: flex-start; gap: var(--sp-3); cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--cyan); margin-top: 2px; flex-shrink: 0; }
.check span { font-size: var(--fs-sm); color: var(--text-soft); }

/* ── Network / option picker ────────────────────────────────── */
.picker { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--sp-3); }
.picker-item {
    position: relative;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: var(--sp-2);
    padding: var(--sp-4) var(--sp-2);
    background: var(--bg-alt);
    border: 1.5px solid var(--line);
    border-radius: var(--r);
    cursor: pointer;
    transition: border-color var(--t-fast), background var(--t-fast), transform var(--t-fast);
    text-align: center;
}
.picker-item:hover { border-color: var(--line-strong); transform: translateY(-2px); }
.picker-item input { position: absolute; opacity: 0; pointer-events: none; }
.picker-item .picker-logo {
    width: 42px; height: 42px; border-radius: 50%;
    display: grid; place-items: center;
    font-family: var(--font-display); font-weight: 700; font-size: var(--fs-sm);
    color: var(--ink);
}
.picker-item .picker-name { font-size: var(--fs-xs); font-weight: 600; color: var(--text-soft); }
.picker-item input:checked ~ .picker-name { color: var(--text); }
.picker-item:has(input:checked) {
    border-color: var(--cyan);
    background: var(--cyan-faint);
    box-shadow: 0 0 0 3px var(--cyan-faint);
}
.picker-item:has(input:checked)::after {
    content: '✓'; position: absolute; top: 6px; right: 8px;
    font-size: 11px; font-weight: 700; color: var(--cyan);
}
.logo-mtn { background: var(--mtn); }
.logo-glo { background: var(--glo); color: #fff; }
.logo-airtel { background: var(--airtel); color: #fff; }
.logo-9mobile { background: var(--etisalat); color: #fff; }

/* ── Tabs ───────────────────────────────────────────────────── */
.tabs {
    display: flex; gap: var(--sp-1); overflow-x: auto;
    background: var(--bg-alt); padding: var(--sp-1);
    border-radius: var(--r); border: 1px solid var(--line);
    scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
    padding: 0.5rem 1rem; border-radius: var(--r-sm);
    font-size: var(--fs-sm); font-weight: 600; color: var(--text-soft);
    white-space: nowrap; transition: all var(--t-fast);
}
.tab:hover { color: var(--text); }
.tab.active { background: var(--surface-2); color: var(--cyan); box-shadow: var(--shadow-sm); }

/* ── Tables ─────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; border-radius: var(--r); border: 1px solid var(--line); }
.table-wrap { scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
.table-wrap::-webkit-scrollbar { height: 6px; }
.table-wrap::-webkit-scrollbar-track { background: transparent; }
.table-wrap::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 3px; }
.table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.table th {
    background: var(--bg-alt); padding: 0.875rem 1rem; text-align: left;
    font-size: var(--fs-xs); font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.06em; color: var(--text-muted); white-space: nowrap;
    border-bottom: 1px solid var(--line);
}
.table td { padding: 0.875rem 1rem; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr { transition: background var(--t-fast); }
.table tbody tr:hover { background: var(--surface-hover); }

/* ── Empty state ────────────────────────────────────────────── */
.empty { padding: var(--sp-8) var(--sp-5); text-align: center; }
.empty-icon {
    width: 64px; height: 64px; margin: 0 auto var(--sp-4);
    border-radius: 50%; display: grid; place-items: center;
    background: var(--surface-2); color: var(--text-muted); font-size: 26px;
}
.empty h4 { font-size: var(--fs-md); margin-bottom: var(--sp-2); }
.empty p { color: var(--text-muted); font-size: var(--fs-sm); max-width: 40ch; margin-inline: auto; }

/* ── Alerts ─────────────────────────────────────────────────── */
.alert {
    display: flex; gap: var(--sp-3); align-items: flex-start;
    padding: var(--sp-4); border-radius: var(--r);
    border: 1px solid; font-size: var(--fs-sm);
}
.alert i { margin-top: 2px; flex-shrink: 0; }
.alert-info    { background: var(--info-faint);    border-color: var(--cyan);    color: var(--text); }
.alert-warning { background: var(--warning-faint); border-color: var(--gold);    color: var(--text); }
.alert-danger  { background: var(--danger-faint);  border-color: var(--danger);  color: var(--text); }
.alert-success { background: var(--success-faint); border-color: var(--success); color: var(--text); }

/* ── Skeleton loader ────────────────────────────────────────── */
.skeleton {
    background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-hover) 50%, var(--surface-2) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.4s infinite;
    border-radius: var(--r-sm);
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ── Divider ────────────────────────────────────────────────── */
.divider { height: 1px; background: var(--line-soft); margin-block: var(--sp-5); }
.divider-text {
    display: flex; align-items: center; gap: var(--sp-3);
    color: var(--text-muted); font-size: var(--fs-xs);
    text-transform: uppercase; letter-spacing: 0.1em;
    margin-block: var(--sp-5);
}
.divider-text::before, .divider-text::after {
    content: ''; flex: 1; height: 1px; background: var(--line-soft);
}

/* ── Modal ──────────────────────────────────────────────────── */
.modal-overlay {
    position: fixed; inset: 0; z-index: 1000;
    background: var(--overlay); backdrop-filter: blur(6px);
    display: none; place-items: center; padding: var(--sp-4);
}
.modal-overlay.open { display: grid; }
.modal {
    width: 100%; max-width: 440px;
    background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--r-xl); box-shadow: var(--shadow-lg);
    padding: var(--sp-6);
    animation: modalIn var(--t-slow);
    /* Was previously only added per-page as an inline style, so most
       modals had no scroll at all once content ran taller than the
       screen — it just got clipped with no way to reach it. Now the
       default for every modal, everywhere. */
    max-height: 85vh;
    overflow-y: auto;
    overscroll-behavior: contain;     /* scrolling the modal doesn't also scroll the page behind it */
    -webkit-overflow-scrolling: touch; /* smooth momentum scroll on iOS */
}
/* Slim, unobtrusive scrollbar instead of the browser's default —
   matches the same treatment already used on .asb-nav / .sb-nav.
   Content still scrolls the same way (wheel, trackpad, touch drag);
   this only changes how the scrollbar itself looks. */
.modal { scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
.modal::-webkit-scrollbar { width: 6px; }
.modal::-webkit-scrollbar-track { background: transparent; }
.modal::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 3px; }
.modal::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }
@keyframes modalIn { from { opacity: 0; transform: translateY(18px) scale(0.97); } }
.modal-head { text-align: center; margin-bottom: var(--sp-5); }
.modal-head h3 { font-size: var(--fs-lg); margin-bottom: var(--sp-2); }
.modal-head p  { color: var(--text-soft); font-size: var(--fs-sm); }

/* PIN entry — used before every purchase */
.pin-boxes { display: flex; gap: var(--sp-3); justify-content: center; margin-block: var(--sp-5); }
.pin-box {
    width: 54px; height: 60px; text-align: center;
    font-family: var(--font-mono); font-size: var(--fs-xl); font-weight: 700;
    background: var(--bg-alt); border: 1.5px solid var(--line);
    border-radius: var(--r); color: var(--text);
    -moz-appearance: textfield;
}
.pin-box::-webkit-outer-spin-button, .pin-box::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.pin-box:focus { outline: none; border-color: var(--cyan); box-shadow: 0 0 0 4px var(--cyan-faint); }
.pin-box.filled { border-color: var(--cyan); }

/* ── Summary rows (confirm screens, receipts) ───────────────── */
.summary { border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.summary-row {
    display: flex; align-items: center; justify-content: space-between;
    gap: var(--sp-4); padding: 0.875rem 1rem;
    border-bottom: 1px solid var(--line-soft);
}
.summary-row:last-child { border-bottom: none; }
.summary-row .k { font-size: var(--fs-sm); color: var(--text-soft); }
.summary-row .v { font-size: var(--fs-sm); font-weight: 600; text-align: right; }
.summary-row.total { background: var(--bg-alt); }
.summary-row.total .k { font-weight: 700; color: var(--text); }
.summary-row.total .v { font-family: var(--font-mono); font-size: var(--fs-md); color: var(--gold); }

/* ── Copy field (account numbers, referral links, API keys) ── */
.copy-field {
    display: flex; align-items: center; gap: var(--sp-3);
    padding: 0.75rem 0.75rem 0.75rem 1rem;
    background: var(--bg-alt); border: 1.5px dashed var(--line-strong);
    border-radius: var(--r);
}
.copy-field .cf-value {
    flex: 1; font-family: var(--font-mono); font-weight: 600;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.copy-btn {
    display: grid; place-items: center;
    width: 36px; height: 36px; border-radius: var(--r-sm);
    background: var(--surface-2); color: var(--text-soft);
    transition: all var(--t-fast); flex-shrink: 0;
}
.copy-btn:hover { background: var(--cyan); color: var(--ink); }
.copy-btn.copied { background: var(--success); color: #fff; }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 900px) {
    .picker { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
    :root { --fs-2xl: 1.75rem; --fs-3xl: 2.125rem; --fs-4xl: 2.5rem; }
    .container { padding-inline: var(--sp-4); }
    .card { padding: var(--sp-4); }
    .pin-box { width: 46px; height: 54px; font-size: var(--fs-lg); }
}
/* The source archive contains a second legacy component copy below this
   point. Keep it inert so it cannot override the valid system above. */
@supports (display: tata-connect-ignore-duplicate) {
:root { color: var(--text);
    min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 700;
    line-height: var(--lh-tight);
    letter-spacing: -0.02em;
    color: var(--text);
}

a { color: var(--cyan); text-decoration: none; transition: color var(--t-fast); }
a:hover { color: var(--cyan-bright); }

img, svg { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, select, textarea { font-family: inherit; font-size: inherit; }
ul, ol { list-style: none; }

:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; border-radius: 4px; }

/* Numbers use the mono face — balances, stats, references, PINs. */
.num, .mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }

/* ── Utilities ──────────────────────────────────────────────── */
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--sp-5); }
.stack     { display: flex; flex-direction: column; }
.row       { display: flex; align-items: center; }
.between   { display: flex; align-items: center; justify-content: space-between; }
.center    { display: flex; align-items: center; justify-content: center; }
.wrap      { flex-wrap: wrap; }
.grow      { flex: 1; }
.gap-1{gap:var(--sp-1)} .gap-2{gap:var(--sp-2)} .gap-3{gap:var(--sp-3)}
.gap-4{gap:var(--sp-4)} .gap-5{gap:var(--sp-5)} .gap-6{gap:var(--sp-6)}
.mt-2{margin-top:var(--sp-2)} .mt-3{margin-top:var(--sp-3)} .mt-4{margin-top:var(--sp-4)}
.mt-5{margin-top:var(--sp-5)} .mt-6{margin-top:var(--sp-6)}
.mb-2{margin-bottom:var(--sp-2)} .mb-3{margin-bottom:var(--sp-3)} .mb-4{margin-bottom:var(--sp-4)}
.mb-5{margin-bottom:var(--sp-5)} .mb-6{margin-bottom:var(--sp-6)}
.text-center{text-align:center} .text-right{text-align:right}
.text-soft{color:var(--text-soft)} .text-muted{color:var(--text-muted)}
.text-cyan{color:var(--cyan)} .text-gold{color:var(--gold)}
.text-success{color:var(--success)} .text-danger{color:var(--danger)} .text-warning{color:var(--warning)}
.fs-xs{font-size:var(--fs-xs)} .fs-sm{font-size:var(--fs-sm)} .fs-lg{font-size:var(--fs-lg)}
.fw-500{font-weight:500} .fw-600{font-weight:600} .fw-700{font-weight:700}
.hide { display: none !important; }
.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0;
    overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ── Section heading ────────────────────────────────────────── */
.eyebrow {
    display: inline-flex; align-items: center; gap: var(--sp-2);
    font-family: var(--font-mono); font-size: var(--fs-xs);
    text-transform: uppercase; letter-spacing: 0.14em;
    color: var(--cyan); margin-bottom: var(--sp-3);
}
.eyebrow::before {
    content: ''; width: 22px; height: 2px;
    background: var(--cyan); border-radius: 2px;
}

.section-head { margin-bottom: var(--sp-6); }
.section-head h2 { font-size: var(--fs-2xl); margin-bottom: var(--sp-3); }
.section-head p  { color: var(--text-soft); max-width: 58ch; }

/* ── Buttons ────────────────────────────────────────────────── */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    gap: var(--sp-2);
    padding: 0.75rem 1.375rem;
    border-radius: var(--r);
    font-family: var(--font-body);
    font-size: var(--fs-base);
    font-weight: 600;
    white-space: nowrap;
    transition: transform var(--t-fast), filter var(--t-fast),
                background var(--t-fast), box-shadow var(--t-fast);
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }

.btn-gold {
    background: var(--grad-gold);
    color: var(--ink);
    box-shadow: var(--shadow-gold);
}
.btn-gold:hover:not(:disabled) { filter: brightness(1.07); color: var(--ink); }

.btn-cyan {
    background: var(--grad-cyan);
    color: var(--ink);
    box-shadow: var(--shadow-cyan);
}
.btn-cyan:hover:not(:disabled) { filter: brightness(1.07); color: var(--ink); }

.btn-ghost {
    background: transparent;
    border: 1.5px solid var(--line-strong);
    color: var(--text);
}
.btn-ghost:hover:not(:disabled) { border-color: var(--cyan); color: var(--cyan); }

.btn-soft {
    background: var(--surface-2);
    border: 1px solid var(--line);
    color: var(--text);
}
.btn-soft:hover:not(:disabled) { background: var(--surface-hover); }

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover:not(:disabled) { filter: brightness(1.08); color: #fff; }

.btn-block { width: 100%; }
.btn-lg { padding: 0.95rem 1.75rem; font-size: var(--fs-md); }
.btn-sm { padding: 0.5rem 0.875rem; font-size: var(--fs-sm); border-radius: var(--r-sm); }

/* ── Cards ──────────────────────────────────────────────────── */
.card {
    background: var(--grad-card);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    padding: var(--sp-5);
    box-shadow: var(--shadow-sm);
}
.card-flat { background: var(--surface); box-shadow: none; }
.card-head {
    display: flex; align-items: center; justify-content: space-between;
    gap: var(--sp-3); margin-bottom: var(--sp-4);
    padding-bottom: var(--sp-4); border-bottom: 1px solid var(--line-soft);
}
.card-head h3 { font-size: var(--fs-md); }

/* Glow rim used on hero/primary cards */
.card-glow { position: relative; overflow: hidden; }
.card-glow::before {
    content: ''; position: absolute; inset: 0;
    padding: 1px; border-radius: inherit;
    background: linear-gradient(140deg, var(--cyan-glow), transparent 42%, var(--gold-glow));
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor; mask-composite: exclude;
    pointer-events: none;
}

/* ── Badges & pills ─────────────────────────────────────────── */
.badge {
    display: inline-flex; align-items: center; gap: 0.375rem;
    padding: 0.25rem 0.625rem;
    border-radius: var(--r-full);
    font-size: var(--fs-xs); font-weight: 600;
    line-height: 1.5;
}
.badge-success { background: var(--success-faint); color: var(--success); }
.badge-warning { background: var(--warning-faint); color: var(--warning); }
.badge-danger  { background: var(--danger-faint);  color: var(--danger);  }
.badge-info    { background: var(--info-faint);    color: var(--info);    }
.badge-muted   { background: var(--surface-2); color: var(--text-soft); }
.badge-gold    { background: var(--gold-faint); color: var(--gold); }

.badge-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* ── Forms ──────────────────────────────────────────────────── */
.field { margin-bottom: var(--sp-4); }
.label {
    display: block; margin-bottom: var(--sp-2);
    font-size: var(--fs-sm); font-weight: 600; color: var(--text-soft);
}
.label .req { color: var(--danger); }

.input, .select, .textarea {
    width: 100%;
    padding: 0.8125rem 1rem;
    background: var(--bg-alt);
    border: 1.5px solid var(--line);
    border-radius: var(--r);
    color: var(--text);
    transition: border-color var(--t-fast), box-shadow var(--t-fast), background var(--t-fast);
}
.input::placeholder, .textarea::placeholder { color: var(--text-muted); }
.input:focus, .select:focus, .textarea:focus {
    outline: none;
    border-color: var(--cyan);
    box-shadow: 0 0 0 4px var(--cyan-faint);
}
.input:disabled, .select:disabled { opacity: 0.6; cursor: not-allowed; }
.textarea { min-height: 120px; resize: vertical; line-height: var(--lh-normal); }

.select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%239FB0C9' stroke-width='2.5' stroke-linecap='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

.input-money { font-family: var(--font-mono); font-size: var(--fs-lg); font-weight: 600; }

.input-group { position: relative; }
.input-group .input { padding-left: 2.75rem; }
.input-group .input-icon {
    position: absolute; left: 1rem; top: 50%; transform: translateY(-50%);
    color: var(--text-muted); pointer-events: none; font-size: var(--fs-sm);
}
.input-group .input-suffix {
    position: absolute; right: 0.5rem; top: 50%; transform: translateY(-50%);
}

.hint { margin-top: var(--sp-2); font-size: var(--fs-xs); color: var(--text-muted); }
.error-text { margin-top: var(--sp-2); font-size: var(--fs-xs); color: var(--danger); }
.field.has-error .input, .field.has-error .select { border-color: var(--danger); }

/* Checkbox / radio */
.check { display: flex; align-items: flex-start; gap: var(--sp-3); cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--cyan); margin-top: 2px; flex-shrink: 0; }
.check span { font-size: var(--fs-sm); color: var(--text-soft); }

/* ── Network / option picker ────────────────────────────────── */
.picker { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--sp-3); }
.picker-item {
    position: relative;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: var(--sp-2);
    padding: var(--sp-4) var(--sp-2);
    background: var(--bg-alt);
    border: 1.5px solid var(--line);
    border-radius: var(--r);
    cursor: pointer;
    transition: border-color var(--t-fast), background var(--t-fast), transform var(--t-fast);
    text-align: center;
}
.picker-item:hover { border-color: var(--line-strong); transform: translateY(-2px); }
.picker-item input { position: absolute; opacity: 0; pointer-events: none; }
.picker-item .picker-logo {
    width: 42px; height: 42px; border-radius: 50%;
    display: grid; place-items: center;
    font-family: var(--font-display); font-weight: 700; font-size: var(--fs-sm);
    color: var(--ink);
}
.picker-item .picker-name { font-size: var(--fs-xs); font-weight: 600; color: var(--text-soft); }
.picker-item input:checked ~ .picker-name { color: var(--text); }
.picker-item:has(input:checked) {
    border-color: var(--cyan);
    background: var(--cyan-faint);
    box-shadow: 0 0 0 3px var(--cyan-faint);
}
.picker-item:has(input:checked)::after {
    content: '✓'; position: absolute; top: 6px; right: 8px;
    font-size: 11px; font-weight: 700; color: var(--cyan);
}
.logo-mtn { background: var(--mtn); }
.logo-glo { background: var(--glo); color: #fff; }
.logo-airtel { background: var(--airtel); color: #fff; }
.logo-9mobile { background: var(--etisalat); color: #fff; }

/* ── Tabs ───────────────────────────────────────────────────── */
.tabs {
    display: flex; gap: var(--sp-1); overflow-x: auto;
    background: var(--bg-alt); padding: var(--sp-1);
    border-radius: var(--r); border: 1px solid var(--line);
    scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
    padding: 0.5rem 1rem; border-radius: var(--r-sm);
    font-size: var(--fs-sm); font-weight: 600; color: var(--text-soft);
    white-space: nowrap; transition: all var(--t-fast);
}
.tab:hover { color: var(--text); }
.tab.active { background: var(--surface-2); color: var(--cyan); box-shadow: var(--shadow-sm); }

/* ── Tables ─────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; border-radius: var(--r); border: 1px solid var(--line); }
.table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.table th {
    background: var(--bg-alt); padding: 0.875rem 1rem; text-align: left;
    font-size: var(--fs-xs); font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.06em; color: var(--text-muted); white-space: nowrap;
    border-bottom: 1px solid var(--line);
}
.table td { padding: 0.875rem 1rem; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr { transition: background var(--t-fast); }
.table tbody tr:hover { background: var(--surface-hover); }

/* ── Empty state ────────────────────────────────────────────── */
.empty { padding: var(--sp-8) var(--sp-5); text-align: center; }
.empty-icon {
    width: 64px; height: 64px; margin: 0 auto var(--sp-4);
    border-radius: 50%; display: grid; place-items: center;
    background: var(--surface-2); color: var(--text-muted); font-size: 26px;
}
.empty h4 { font-size: var(--fs-md); margin-bottom: var(--sp-2); }
.empty p { color: var(--text-muted); font-size: var(--fs-sm); max-width: 40ch; margin-inline: auto; }

/* ── Alerts ─────────────────────────────────────────────────── */
.alert {
    display: flex; gap: var(--sp-3); align-items: flex-start;
    padding: var(--sp-4); border-radius: var(--r);
    border: 1px solid; font-size: var(--fs-sm);
}
.alert i { margin-top: 2px; flex-shrink: 0; }
.alert-info    { background: var(--info-faint);    border-color: var(--cyan);    color: var(--text); }
.alert-warning { background: var(--warning-faint); border-color: var(--gold);    color: var(--text); }
.alert-danger  { background: var(--danger-faint);  border-color: var(--danger);  color: var(--text); }
.alert-success { background: var(--success-faint); border-color: var(--success); color: var(--text); }

/* ── Skeleton loader ────────────────────────────────────────── */
.skeleton {
    background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-hover) 50%, var(--surface-2) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.4s infinite;
    border-radius: var(--r-sm);
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ── Divider ────────────────────────────────────────────────── */
.divider { height: 1px; background: var(--line-soft); margin-block: var(--sp-5); }
.divider-text {
    display: flex; align-items: center; gap: var(--sp-3);
    color: var(--text-muted); font-size: var(--fs-xs);
    text-transform: uppercase; letter-spacing: 0.1em;
    margin-block: var(--sp-5);
}
.divider-text::before, .divider-text::after {
    content: ''; flex: 1; height: 1px; background: var(--line-soft);
}

/* ── Modal ──────────────────────────────────────────────────── */
.modal-overlay {
    position: fixed; inset: 0; z-index: 1000;
    background: var(--overlay); backdrop-filter: blur(6px);
    display: none; place-items: center; padding: var(--sp-4);
}
.modal-overlay.open { display: grid; }
.modal {
    width: 100%; max-width: 440px;
    background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--r-xl); box-shadow: var(--shadow-lg);
    padding: var(--sp-6);
    animation: modalIn var(--t-slow);
}
@keyframes modalIn { from { opacity: 0; transform: translateY(18px) scale(0.97); } }
.modal-head { text-align: center; margin-bottom: var(--sp-5); }
.modal-head h3 { font-size: var(--fs-lg); margin-bottom: var(--sp-2); }
.modal-head p  { color: var(--text-soft); font-size: var(--fs-sm); }

/* PIN entry — used before every purchase */
.pin-boxes { display: flex; gap: var(--sp-3); justify-content: center; margin-block: var(--sp-5); }
.pin-box {
    width: 54px; height: 60px; text-align: center;
    font-family: var(--font-mono); font-size: var(--fs-xl); font-weight: 700;
    background: var(--bg-alt); border: 1.5px solid var(--line);
    border-radius: var(--r); color: var(--text);
    -moz-appearance: textfield;
}
.pin-box::-webkit-outer-spin-button, .pin-box::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.pin-box:focus { outline: none; border-color: var(--cyan); box-shadow: 0 0 0 4px var(--cyan-faint); }
.pin-box.filled { border-color: var(--cyan); }

/* ── Summary rows (confirm screens, receipts) ───────────────── */
.summary { border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.summary-row {
    display: flex; align-items: center; justify-content: space-between;
    gap: var(--sp-4); padding: 0.875rem 1rem;
    border-bottom: 1px solid var(--line-soft);
}
.summary-row:last-child { border-bottom: none; }
.summary-row .k { font-size: var(--fs-sm); color: var(--text-soft); }
.summary-row .v { font-size: var(--fs-sm); font-weight: 600; text-align: right; }
.summary-row.total { background: var(--bg-alt); }
.summary-row.total .k { font-weight: 700; color: var(--text); }
.summary-row.total .v { font-family: var(--font-mono); font-size: var(--fs-md); color: var(--gold); }

/* ── Copy field (account numbers, referral links, API keys) ── */
.copy-field {
    display: flex; align-items: center; gap: var(--sp-3);
    padding: 0.75rem 0.75rem 0.75rem 1rem;
    background: var(--bg-alt); border: 1.5px dashed var(--line-strong);
    border-radius: var(--r);
}
.copy-field .cf-value {
    flex: 1; font-family: var(--font-mono); font-weight: 600;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.copy-btn {
    display: grid; place-items: center;
    width: 36px; height: 36px; border-radius: var(--r-sm);
    background: var(--surface-2); color: var(--text-soft);
    transition: all var(--t-fast); flex-shrink: 0;
}
.copy-btn:hover { background: var(--cyan); color: var(--ink); }
.copy-btn.copied { background: var(--success); color: #fff; }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 900px) {
    .picker { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
    :root { --fs-2xl: 1.75rem; --fs-3xl: 2.125rem; --fs-4xl: 2.5rem; }
    .container { padding-inline: var(--sp-4); }
    .card { padding: var(--sp-4); }
    .pin-box { width: 46px; height: 54px; font-size: var(--fs-lg); }
}
}
