:root {
    --ink: #102a43;
    --muted: #62758a;
    --line: #dce5ed;
    --surface: #ffffff;
    --background: #f4f7fa;
    --primary: #126e82;
    --primary-dark: #0b5263;
    --accent: #22a699;
    --paypal: #0070ba;
    --danger: #b42318;
    --warning: #8a5300;
    --success: #157347;
    --shadow: 0 12px 35px rgba(16, 42, 67, .07);
}

* { box-sizing: border-box; }
html { min-height: 100%; }
body { margin: 0; min-height: 100vh; color: var(--ink); background: var(--background); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; line-height: 1.6; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { line-height: 1.2; letter-spacing: -.025em; }
h1 { margin-bottom: 1rem; font-size: clamp(2rem, 5vw, 3.6rem); }
h2 { margin-bottom: .75rem; font-size: 1.3rem; }
p { color: var(--muted); }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
.skip-link { position: absolute; left: 1rem; top: -5rem; z-index: 100; padding: .7rem 1rem; background: var(--surface); border-radius: .5rem; }
.skip-link:focus { top: 1rem; }
.site-header { background: rgba(255, 255, 255, .96); border-bottom: 1px solid var(--line); }
.nav-wrapper { max-width: 1180px; min-height: 74px; margin: 0 auto; padding: .8rem 1.5rem; display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; }
.brand { display: inline-flex; align-items: center; gap: .65rem; color: var(--ink); font-size: 1.08rem; font-weight: 800; letter-spacing: -.02em; white-space: nowrap; }
.brand:hover { color: var(--ink); }
.brand-mark { display: grid; place-items: center; width: 36px; height: 36px; color: #fff; background: var(--primary); border-radius: 11px; font-size: 1.15rem; }
.main-nav { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 1.25rem; }
.main-nav > a { color: #3f556c; font-size: .92rem; font-weight: 600; }
.main-nav > a:hover { color: var(--primary); }
.logout-form { margin: 0; }
.nav-button { padding: 0; border: 0; color: #3f556c; background: none; font-size: .92rem; font-weight: 600; cursor: pointer; }
.nav-button:hover { color: var(--primary); }
.page-shell { width: min(1120px, calc(100% - 3rem)); min-height: calc(100vh - 155px); margin: 0 auto; padding: 3.5rem 0; }
.site-footer { padding: 1.5rem; border-top: 1px solid var(--line); color: var(--muted); text-align: center; font-size: .85rem; }
.eyebrow, .card-label { display: block; margin-bottom: .75rem; color: var(--primary); font-size: .75rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.lead { font-size: 1.1rem; }
.hero { display: grid; grid-template-columns: 1.05fr .95fr; gap: 4rem; align-items: center; min-height: 490px; }
.hero-copy h1 { margin-bottom: 1.4rem; font-size: clamp(3rem, 6.5vw, 5rem); }
.hero-copy > p { max-width: 540px; font-size: 1.12rem; }
.hero-panel { padding: 1.4rem 2rem; background: var(--surface); border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow); }
.feature-row { display: flex; gap: 1.25rem; padding: 1.6rem 0; }
.feature-row + .feature-row { border-top: 1px solid var(--line); }
.feature-row h2 { margin-bottom: .4rem; font-size: 1.08rem; }
.feature-row p { margin: 0; font-size: .9rem; }
.feature-icon { display: grid; place-items: center; flex: 0 0 44px; height: 44px; border-radius: 12px; color: var(--primary); background: #e8f4f4; font-size: .75rem; font-weight: 800; }
.trust-strip { display: flex; justify-content: space-around; flex-wrap: wrap; gap: 1rem; margin-top: 2.5rem; padding: 1.25rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .8rem; font-weight: 700; letter-spacing: .04em; }
.button-row { display: flex; align-items: center; flex-wrap: wrap; gap: .8rem; margin-top: 1.8rem; }
.button-row.centered { justify-content: center; }
.button, .btn { display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: .72rem 1.25rem; border: 1px solid var(--primary); border-radius: 10px; color: #fff; background: var(--primary); font-weight: 700; font-size: .92rem; line-height: 1.2; cursor: pointer; transition: background .15s, border-color .15s, transform .15s; }
.button:hover, .btn:hover { color: #fff; background: var(--primary-dark); border-color: var(--primary-dark); transform: translateY(-1px); }
.button:focus-visible, .btn:focus-visible, a:focus-visible, button:focus-visible { outline: 3px solid rgba(18, 110, 130, .25); outline-offset: 3px; }
.button-secondary, .btn-secondary { color: var(--ink); background: transparent; border-color: var(--line); }
.button-secondary:hover, .btn-secondary:hover { color: var(--ink); background: #edf2f6; border-color: #bdcbd7; }
.button-small, .btn-small { min-height: 38px; padding: .5rem .85rem; font-size: .82rem; }
.button-full { width: 100%; margin-top: .5rem; }
.button-danger, .btn-danger { color: #fff; background: var(--danger); border-color: var(--danger); }
.button-danger:hover, .btn-danger:hover { background: #8e1c13; border-color: #8e1c13; }
.paypal-button { background: var(--paypal); border-color: var(--paypal); }
.paypal-button:hover { background: #005c99; border-color: #005c99; }
.button:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 2rem; margin-bottom: 2rem; }
.page-heading h1 { margin-bottom: .65rem; font-size: clamp(2rem, 4vw, 3rem); }
.page-heading p { margin: 0; }
.dashboard-grid { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 1.25rem; margin-bottom: 1.5rem; }
.card { padding: 1.6rem; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 4px 15px rgba(16, 42, 67, .025); }
.balance-card { display: flex; flex-direction: column; min-height: 230px; padding: 1.7rem; color: #fff; background: linear-gradient(135deg, #123d54, #126e82); border-radius: 16px; box-shadow: var(--shadow); }
.balance-card:hover { color: #fff; }
.balance-card .card-label { color: #b8e2e3; }
.balance-value { margin: auto 0; font-size: clamp(2.2rem, 4vw, 3.1rem); letter-spacing: -.04em; }
.balance-value small, .wallet-balance-card small { font-size: .9rem; font-weight: 500; letter-spacing: 0; }
.balance-card .card-link { color: #fff; }
.card-link { display: inline-block; margin-top: auto; color: var(--primary); font-size: .88rem; font-weight: 750; }
.card-link:hover { color: var(--primary-dark); }
.action-card { display: flex; flex-direction: column; min-height: 230px; }
.action-card p { font-size: .9rem; overflow-wrap: anywhere; }
.recent-card { margin-top: 1.5rem; }
.section-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1rem; margin-bottom: 1rem; }
.section-heading h2, .section-heading .card-label { margin-bottom: 0; }
.section-heading > a { font-size: .85rem; font-weight: 700; }
.table-wrapper { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th { padding: .8rem .65rem; border-bottom: 1px solid var(--line); color: var(--muted); text-align: left; font-size: .73rem; letter-spacing: .05em; text-transform: uppercase; }
td { padding: 1rem .65rem; border-bottom: 1px solid #edf1f5; white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
.number { text-align: right; font-variant-numeric: tabular-nums; }
.positive { color: var(--success); font-weight: 700; }
.negative { color: var(--danger); font-weight: 700; }
.reference { color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .78rem; overflow-wrap: anywhere; }
.transaction-type { font-weight: 650; }
.empty-state { padding: 2rem 1rem; text-align: center; }
.empty-state p { margin-bottom: 1rem; }
.messages { margin-bottom: 1.5rem; }
.alert { padding: 1rem 1.15rem; border: 1px solid #b9d8e5; border-radius: 12px; color: #164b63; background: #eaf5f9; font-size: .92rem; }
.alert + .alert { margin-top: .75rem; }
.alert p { margin: .25rem 0 0; color: inherit; }
.alert-success { border-color: #b8dfc8; color: #145c32; background: #edf9f1; }
.alert-warning { border-color: #ead3a2; color: #714600; background: #fff8e9; }
.alert-error { border-color: #f0bdb8; color: #8e1c13; background: #fff1f0; }
.verification-banner { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1.5rem; }
.auth-layout, .topup-layout { display: grid; grid-template-columns: 1fr 440px; gap: 5rem; align-items: center; max-width: 1000px; margin: 1rem auto; }
.auth-intro h1, .topup-layout h1 { font-size: clamp(2.4rem, 5vw, 3.7rem); }
.form-card h1 { font-size: 2rem; }
.form-card form { margin-top: 1.5rem; }
.narrow-card { max-width: 570px; margin: 1rem auto; padding: 2rem; }
.form-field { margin-bottom: 1.2rem; }
.form-field label, .control-label { display: block; margin-bottom: .4rem; color: #29445c; font-size: .86rem; font-weight: 700; }
input:not([type="checkbox"]):not([type="radio"]), textarea, select { width: 100%; min-height: 46px; padding: .7rem .8rem; border: 1px solid #bdccda; border-radius: 9px; color: var(--ink); background: #fff; }
textarea { min-height: 90px; resize: vertical; }
input:focus, textarea:focus, select:focus { border-color: var(--primary); outline: 3px solid rgba(18, 110, 130, .12); }
input[readonly], textarea[readonly] { color: var(--muted); background: #f5f7f9; }
.help-text, .help-block { display: block; margin-top: .4rem; color: var(--muted); font-size: .78rem; }
.help-text ul { margin: .4rem 0 0; padding-left: 1.2rem; }
.errorlist { margin: .4rem 0 0; padding: 0; color: var(--danger); list-style: none; font-size: .8rem; }
.errorlist li + li { margin-top: .2rem; }
.field-invalid input, .error input { border-color: var(--danger); }
.form-errors .errorlist, .help-inline { color: var(--danger); font-size: .82rem; }
.text-link { display: inline-block; margin-top: 1.2rem; font-size: .85rem; font-weight: 650; }
.form-footer { margin: 1.5rem 0 0; padding-top: 1.25rem; border-top: 1px solid var(--line); text-align: center; font-size: .85rem; }
.settings-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 1.5rem; align-items: start; }
.settings-side { display: grid; gap: 1.5rem; }
.compact-card { display: flex; flex-direction: column; }
.compact-card p { font-size: .88rem; }
.status-badge { display: inline-flex; align-items: center; padding: .3rem .6rem; border-radius: 999px; font-size: .72rem; font-weight: 750; }
.status-success { color: #145c32; background: #e7f6ec; }
.status-warning { color: #714600; background: #fff1cc; }
.status-card { max-width: 650px; margin: 2rem auto; padding: 3rem 2rem; text-align: center; }
.status-card h1 { font-size: 2.2rem; }
.status-card p { max-width: 500px; margin-left: auto; margin-right: auto; }
.status-icon { display: grid; place-items: center; width: 64px; height: 64px; margin: 0 auto 1.5rem; border-radius: 50%; font-size: 1.8rem; font-weight: 700; }
.status-icon-success { color: var(--success); background: #e7f6ec; }
.status-icon-warning { color: var(--warning); background: #fff1cc; }
.wallet-balance-card { display: flex; flex-direction: column; margin-bottom: 1.5rem; padding: 2rem; color: #fff; background: linear-gradient(120deg, #123d54, #126e82); border-radius: 16px; }
.wallet-balance-card .card-label { color: #b8e2e3; }
.wallet-balance-card > strong { margin: .5rem 0; font-size: clamp(2.5rem, 6vw, 4rem); letter-spacing: -.04em; }
.wallet-balance-card > span:last-child { color: #c6dde5; font-size: .8rem; }
.pagination { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding-top: 1.25rem; font-size: .85rem; }
.quick-amounts { display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; margin: 1.2rem 0; }
.quick-amounts button { padding: .55rem .3rem; border: 1px solid var(--line); border-radius: 8px; color: var(--primary); background: #f7fafb; font-weight: 700; cursor: pointer; }
.quick-amounts button:hover { border-color: var(--primary); background: #eaf5f5; }
.security-note { margin-top: 2rem; padding: 1.25rem; border-left: 3px solid var(--accent); background: #eaf5f4; }
.security-note p { margin: .35rem 0 0; font-size: .85rem; }
.config-notice { margin-top: 1rem; font-size: .8rem; }
.provider-shell { width: min(760px, calc(100% - 3rem)); min-height: calc(100vh - 75px); margin: 0 auto; padding: 3.5rem 0; }
.provider-card h1 { font-size: 2.25rem; }
.permission-box { margin: 1.5rem 0; padding: 1.2rem; border: 1px solid var(--line); border-radius: 12px; background: #f7fafb; }
.permission-box h2 { font-size: 1rem; }
.permission-list { margin: 0; padding: 0; list-style: none; }
.permission-list li { position: relative; padding: .65rem .5rem .65rem 1.6rem; }
.permission-list li::before { content: "✓"; position: absolute; left: 0; color: var(--success); font-weight: 800; }
.permission-list.compact li { padding-top: .25rem; padding-bottom: .25rem; }
.access-card { margin-bottom: 1rem; }
.block-center { max-width: 650px; margin: 0 auto; padding: 2rem; background: #fff; border: 1px solid var(--line); border-radius: 16px; }
.block-center-heading { font-size: 1.8rem; }
.control-group { margin-bottom: 1rem; }
.controls { display: flex; flex-wrap: wrap; gap: .7rem; }
.controls input[type="submit"] { width: auto; }
.unstyled { padding: 0; list-style: none; }
.unstyled > li { margin-bottom: 1rem; }
.input-block-level { width: 100%; }
.btn-toolbar { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: 1.5rem; }
.provider-body .block-center > ul { padding-left: 1.2rem; }

@media (max-width: 900px) {
    .hero { grid-template-columns: 1fr; gap: 2rem; padding-top: 1rem; }
    .hero-copy h1 { font-size: clamp(3rem, 10vw, 4.5rem); }
    .dashboard-grid { grid-template-columns: 1fr 1fr; }
    .balance-card { grid-column: 1 / -1; }
    .auth-layout, .topup-layout { grid-template-columns: 1fr; gap: 2rem; max-width: 650px; }
    .settings-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
    .nav-wrapper { align-items: flex-start; gap: .8rem; padding: .8rem 1rem; }
    .main-nav { gap: .75rem; }
    .main-nav > a, .nav-button { font-size: .8rem; }
    .brand > span:last-child { display: none; }
    .page-shell, .provider-shell { width: min(100% - 2rem, 1120px); padding: 2rem 0; }
    .hero { min-height: auto; }
    .hero-copy h1 { font-size: 3rem; }
    .hero-panel { padding: .5rem 1.2rem; }
    .dashboard-grid { grid-template-columns: 1fr; }
    .balance-card { grid-column: auto; }
    .page-heading, .wallet-heading { align-items: flex-start; flex-direction: column; gap: 1rem; }
    .verification-banner { align-items: flex-start; flex-direction: column; }
    .card, .narrow-card { padding: 1.25rem; }
    .status-card { padding: 2rem 1.25rem; }
    .trust-strip { justify-content: flex-start; }
    th, td { padding: .75rem .5rem; }
    .pagination { flex-wrap: wrap; }
}
