:root {
    --mp-teal: #0f6b5c;
    --mp-teal-mid: #147a6a;
    --mp-teal-soft: #1a8a78;
    --mp-ink: #1a2430;
    --mp-muted: #6b7785;
    --mp-line: #e6ecf2;
    --mp-bg: #f3f5f8;
    --mp-card: #ffffff;
    --mp-shadow: 0 10px 28px rgba(20, 40, 60, .07);
    --mp-radius: 22px;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
    font-family: "Segoe UI", "Metropolis", system-ui, sans-serif;
    color: var(--mp-ink);
    background: var(--mp-bg);
}

a { color: inherit; }

/* ---------- Auth (desktop) ---------- */
.mp-auth-body {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 32px 20px;
    background:
        radial-gradient(900px 420px at 12% -10%, rgba(20, 122, 106, .18), transparent 60%),
        radial-gradient(700px 380px at 95% 10%, rgba(15, 80, 70, .12), transparent 55%),
        linear-gradient(165deg, #e8eef4, #f5f7fa 48%, #e7f3ef);
}

.mp-auth-shell {
    width: min(980px, 100%);
    display: grid;
    grid-template-columns: 1.05fr .95fr;
    background: #fff;
    border-radius: 28px;
    overflow: hidden;
    box-shadow: 0 24px 60px rgba(20, 40, 70, .12);
    border: 1px solid rgba(255,255,255,.7);
}

.mp-auth-hero {
    background: linear-gradient(155deg, #0d5a4e 0%, #147a6a 55%, #1f9a86 100%);
    color: #fff;
    padding: 42px 40px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 520px;
}

.mp-auth-hero h2 {
    margin: 28px 0 10px;
    font-size: 34px;
    line-height: 1.15;
    letter-spacing: -.02em;
}

.mp-auth-hero p {
    margin: 0;
    opacity: .9;
    font-size: 15px;
    line-height: 1.55;
    max-width: 34ch;
}

.mp-auth-mark {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: rgba(255,255,255,.16);
    display: grid;
    place-items: center;
    font-weight: 800;
    font-size: 18px;
    letter-spacing: .04em;
}

.mp-auth-panel {
    padding: 48px 44px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.mp-auth-panel h1 {
    margin: 0 0 6px;
    font-size: 28px;
    letter-spacing: -.02em;
}

.mp-auth-sub {
    margin: 0 0 24px;
    color: var(--mp-muted);
    font-size: 14px;
}

.mp-form { display: grid; gap: 14px; }
.mp-field label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 6px;
}
.mp-field input {
    width: 100%;
    border: 1px solid #d7e0ea;
    border-radius: 12px;
    padding: 12px 14px;
    font: inherit;
    font-size: 15px;
    background: #fbfcfe;
}
.mp-field input:focus {
    outline: 2px solid rgba(20, 122, 106, .25);
    border-color: #147a6a;
    background: #fff;
}

.mp-btn {
    border: none;
    border-radius: 12px;
    padding: 12px 16px;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.mp-btn--primary {
    background: linear-gradient(135deg, #0f6b5c, #178575);
    color: #fff;
    box-shadow: 0 10px 20px rgba(15, 107, 92, .22);
}
.mp-btn--block { width: 100%; }
.mp-btn--ghost {
    background: #fff;
    border: 1px solid var(--mp-line);
    color: var(--mp-ink);
}

.mp-alert {
    border-radius: 12px;
    padding: 10px 12px;
    margin-bottom: 14px;
    font-size: 13px;
}
.mp-alert--error {
    background: #fdeceb;
    color: #9b2c2c;
    border: 1px solid #f5c2c0;
}
.mp-alert ul { margin: 0; padding-left: 16px; }

.mp-auth-hint {
    margin: 14px 0 0;
    color: var(--mp-muted);
    font-size: 12px;
    line-height: 1.45;
}

/* ---------- App shell (desktop home) ---------- */
.mp-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.mp-topbar {
    background: #fff;
    border-bottom: 1px solid var(--mp-line);
    padding: 14px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    position: sticky;
    top: 0;
    z-index: 20;
}

.mp-brand-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.mp-brand-mark {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: var(--mp-teal);
    color: #fff;
    display: grid;
    place-items: center;
    font-weight: 800;
    font-size: 15px;
    letter-spacing: .03em;
}

.mp-welcome small {
    display: block;
    color: var(--mp-muted);
    font-size: 13px;
}
.mp-welcome strong {
    display: block;
    font-size: 20px;
    letter-spacing: -.01em;
    margin-top: 1px;
}

.mp-top-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.mp-icon-btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 1px solid var(--mp-line);
    background: #fff;
    display: grid;
    place-items: center;
    color: var(--mp-teal);
    box-shadow: 0 4px 12px rgba(20, 40, 60, .05);
}

.mp-content {
    width: min(1120px, calc(100% - 48px));
    margin: 0 auto;
    padding: 28px 0 48px;
}

/* Balance hero */
.mp-balance {
    background: linear-gradient(135deg, #0d5a4e 0%, #147a6a 48%, #1d9382 100%);
    color: #fff;
    border-radius: 26px;
    padding: 28px 32px;
    box-shadow: 0 18px 36px rgba(13, 90, 78, .22);
    margin-bottom: 22px;
    position: relative;
    overflow: hidden;
}
.mp-balance::after {
    content: "";
    position: absolute;
    width: 280px;
    height: 280px;
    right: -80px;
    top: -120px;
    border-radius: 50%;
    background: rgba(255,255,255,.08);
}
.mp-balance-product {
    font-size: 14px;
    font-weight: 600;
    opacity: .92;
    position: relative;
}
.mp-balance-amount {
    margin: 14px 0 10px;
    font-size: 44px;
    font-weight: 800;
    letter-spacing: -.02em;
    position: relative;
}
.mp-balance-meta {
    font-size: 13px;
    opacity: .88;
    position: relative;
}

/* Quick actions */
.mp-quick {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 28px;
}
.mp-quick a {
    background: #fff;
    border-radius: 18px;
    border: 1px solid var(--mp-line);
    box-shadow: var(--mp-shadow);
    text-decoration: none;
    padding: 18px 12px 16px;
    text-align: center;
    transition: transform .15s ease, border-color .15s ease;
}
.mp-quick a:hover {
    transform: translateY(-2px);
    border-color: #c9d8e4;
}
.mp-quick-ico {
    width: 48px;
    height: 48px;
    margin: 0 auto 10px;
    border-radius: 50%;
    background: #eef7f5;
    color: var(--mp-teal);
    display: grid;
    place-items: center;
    font-size: 18px;
    font-weight: 800;
}
.mp-quick strong {
    display: block;
    font-size: 14px;
}

/* Services */
.mp-section-title {
    margin: 0 0 14px;
    font-size: 22px;
    letter-spacing: -.015em;
}

.mp-services {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 14px;
}
.mp-service {
    background: #fff;
    border: 1px solid var(--mp-line);
    border-radius: 18px;
    box-shadow: var(--mp-shadow);
    text-decoration: none;
    padding: 22px 14px 18px;
    text-align: center;
    min-height: 128px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    transition: transform .15s ease, border-color .15s ease;
}
.mp-service:hover {
    transform: translateY(-2px);
    border-color: #c9d8e4;
}
.mp-service-ico {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: #eef7f5;
    color: var(--mp-teal-mid);
    display: grid;
    place-items: center;
    font-weight: 800;
    font-size: 15px;
}
.mp-service-ico--warn { background: #fff4e8; color: #d97706; }
.mp-service-ico--blue { background: #eef4ff; color: #2563eb; }
.mp-service strong {
    font-size: 14px;
    line-height: 1.25;
}

/* Module page */
.mp-module-card {
    background: #fff;
    border: 1px solid var(--mp-line);
    border-radius: 22px;
    box-shadow: var(--mp-shadow);
    padding: 28px;
}
.mp-module-card h1 {
    margin: 0 0 8px;
    font-size: 28px;
}
.mp-module-card p {
    margin: 0 0 18px;
    color: var(--mp-muted);
}

/* ---------- Service panels ---------- */
.mp-page-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 18px;
}
.mp-eyebrow {
    color: var(--mp-teal);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .08em;
    margin-bottom: 6px;
}
.mp-page-head h1 {
    margin: 0;
    font-size: 30px;
    letter-spacing: -.02em;
}
.mp-page-sub {
    margin: 6px 0 0;
    color: var(--mp-muted);
    font-size: 14px;
}
.mp-page-actions { display: flex; gap: 8px; flex-shrink: 0; }

.mp-alert--ok {
    background: #e8f8f0;
    color: #146c43;
    border: 1px solid #b7ebd0;
    border-radius: 12px;
    padding: 10px 12px;
    margin-bottom: 14px;
    font-size: 13px;
}

.mp-grid-2 {
    display: grid;
    grid-template-columns: 1.35fr .9fr;
    gap: 16px;
}
.mp-card {
    background: #fff;
    border: 1px solid var(--mp-line);
    border-radius: 20px;
    box-shadow: var(--mp-shadow);
    padding: 22px;
}
.mp-card-title {
    margin: 0 0 14px;
    font-size: 18px;
}
.mp-card-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: baseline;
    margin-bottom: 8px;
    flex-wrap: wrap;
}
.mp-meta { color: var(--mp-muted); font-size: 13px; }
.mp-help { margin: 12px 0 0; color: var(--mp-muted); font-size: 12px; line-height: 1.45; }
.mp-empty { color: var(--mp-muted); font-size: 14px; padding: 24px 4px; }
.mp-center { text-align: center; }

.mp-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}
.mp-tab {
    text-decoration: none;
    border: 1px solid var(--mp-line);
    background: #f7fafc;
    color: var(--mp-ink);
    border-radius: 999px;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 700;
}
.mp-tab.is-active {
    background: var(--mp-teal);
    border-color: var(--mp-teal);
    color: #fff;
}

.mp-form select,
.mp-form textarea,
.mp-inline-form select {
    width: 100%;
    border: 1px solid #d7e0ea;
    border-radius: 12px;
    padding: 12px 14px;
    font: inherit;
    font-size: 15px;
    background: #fbfcfe;
}
.mp-form textarea { resize: vertical; min-height: 110px; }
.mp-inline-form {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
    background: #fff;
    border: 1px solid var(--mp-line);
    border-radius: 14px;
    padding: 12px 14px;
    box-shadow: var(--mp-shadow);
}
.mp-inline-form label { font-size: 13px; font-weight: 700; white-space: nowrap; }
.mp-inline-form select { max-width: 420px; }

.mp-checklist {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 10px;
}
.mp-checklist li {
    padding: 10px 12px;
    border-radius: 12px;
    background: #f6faf9;
    font-size: 14px;
    font-weight: 600;
}
.mp-checklist li.is-ok { color: #146c43; }
.mp-checklist li.is-warn { color: #9a6700; background: #fff8e8; }

.mp-list { list-style: none; margin: 0; padding: 0; }
.mp-list li {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    padding: 14px 0;
    border-bottom: 1px solid var(--mp-line);
}
.mp-list li:last-child { border-bottom: none; }
.mp-list strong { display: block; }
.mp-list small { display: block; color: var(--mp-muted); font-size: 12px; margin-top: 3px; }
.mp-list-right { text-align: right; display: grid; gap: 4px; justify-items: end; }
.mp-link {
    color: var(--mp-teal);
    font-weight: 700;
    font-size: 13px;
    text-decoration: none;
}
.mp-pill {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    background: #eef7f5;
    color: var(--mp-teal);
    font-size: 11px;
    font-weight: 800;
    padding: 4px 10px;
}
.mp-pill--light { background: rgba(255,255,255,.2); color: #fff; }

.mp-txn-list { list-style: none; margin: 0; padding: 0; }
.mp-txn-list li {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--mp-line);
}
.mp-txn-list li:last-child { border-bottom: none; }
.mp-txn-left { display: flex; gap: 12px; align-items: center; min-width: 0; }
.mp-txn-left strong { display: block; }
.mp-txn-left small { display: block; color: var(--mp-muted); font-size: 12px; margin-top: 2px; }
.mp-txn-ico {
    width: 36px; height: 36px; border-radius: 50%;
    display: grid; place-items: center; font-weight: 800; flex-shrink: 0;
}
.mp-txn-ico.is-credit { background: #e8f8f0; color: #146c43; }
.mp-txn-ico.is-debit { background: #fdeceb; color: #9b2c2c; }
.mp-txn-amt { font-weight: 800; white-space: nowrap; }
.mp-txn-amt.is-debit { color: #9b2c2c; }

.mp-loan-hero { padding: 28px; }
.mp-loan-id { font-size: 15px; font-weight: 700; margin-top: 8px; }
.mp-loan-amount { font-size: 34px; font-weight: 800; margin: 10px 0 8px; letter-spacing: -.02em; }
.mp-loan-pay { margin-top: 18px; }
.mp-loan-links { margin-top: 14px; }

.mp-dl { margin: 0; display: grid; gap: 12px; }
.mp-dl div {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--mp-line);
}
.mp-dl div:last-child { border-bottom: none; padding-bottom: 0; }
.mp-dl dt { color: var(--mp-muted); font-size: 13px; }
.mp-dl dd { margin: 0; font-weight: 700; font-size: 14px; text-align: right; }

.mp-qr-box {
    width: 220px; height: 220px; margin: 8px auto 16px;
    border-radius: 18px; border: 1px dashed #b7c9c4;
    background: #f7fbfa; display: grid; place-items: center;
}
.mp-qr-fake {
    width: 140px; height: 140px; border-radius: 12px;
    background:
        linear-gradient(#0f6b5c 0 0) 0 0 / 28% 28%,
        linear-gradient(#0f6b5c 0 0) 100% 0 / 28% 28%,
        linear-gradient(#0f6b5c 0 0) 0 100% / 28% 28%,
        linear-gradient(#0f6b5c 0 0) 100% 100% / 28% 28%,
        repeating-linear-gradient(90deg, #0f6b5c 0 8px, transparent 8px 16px);
    background-repeat: no-repeat;
    color: transparent;
}
.mp-qr-id { display: block; font-size: 15px; }

.mp-debit-card {
    background: linear-gradient(135deg, #0d5a4e, #1a8a78);
    color: #fff;
    border-radius: 18px;
    padding: 22px;
    min-height: 170px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.mp-debit-top { display: flex; justify-content: space-between; align-items: center; font-weight: 700; }
.mp-debit-number { font-size: 24px; letter-spacing: .08em; font-weight: 700; margin: 24px 0 10px; }
.mp-debit-meta { opacity: .9; font-size: 13px; }
.mp-btn-row { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; }

@media (max-width: 980px) {
    .mp-auth-shell { grid-template-columns: 1fr; }
    .mp-auth-hero { min-height: auto; padding: 28px; }
    .mp-services { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .mp-grid-2 { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
    .mp-content { width: calc(100% - 28px); padding-top: 18px; }
    .mp-balance-amount { font-size: 34px; }
    .mp-quick { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .mp-services { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .mp-auth-panel { padding: 28px 22px; }
    .mp-page-head { flex-direction: column; }
    .mp-inline-form { flex-direction: column; align-items: stretch; }
    .mp-inline-form select { max-width: none; }
}
