:root {
    --bg: #f5f7fb;
    --surface: #ffffff;
    --text: #172033;
    --muted: #687386;
    --border: #e4e8f0;
    --primary: #1769e0;
    --primary-dark: #0f55bd;
    --success: #14804a;
    --success-bg: #e8f7ef;
    --warning: #8b5d00;
    --warning-bg: #fff6dc;
    --danger: #b42318;
    --danger-bg: #fff0ef;
    --shadow: 0 18px 50px rgba(29, 43, 76, 0.10);
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
textarea {
    font: inherit;
}

.container {
    width: min(1180px, calc(100% - 40px));
    margin: 0 auto;
}

.container-narrow {
    width: min(820px, calc(100% - 40px));
}

.site-header {
    background: rgba(255, 255, 255, 0.92);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(18px);
}

.header-inner {
    min-height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
}

.brand-mark {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    color: white;
    background: linear-gradient(135deg, #1769e0, #6246ea);
    font-weight: 800;
    box-shadow: 0 8px 24px rgba(23, 105, 224, 0.24);
}

.brand > span:last-child {
    display: flex;
    flex-direction: column;
}

.brand strong {
    font-size: 15px;
}

.brand small {
    color: var(--muted);
    margin-top: 1px;
}

.secure-pill {
    color: #465266;
    border: 1px solid var(--border);
    padding: 8px 12px;
    border-radius: 999px;
    font-size: 13px;
    background: white;
}

.lock {
    color: var(--success);
    margin-right: 6px;
}

.site-footer {
    padding: 30px 0 40px;
    color: var(--muted);
    text-align: center;
    font-size: 13px;
}

.admin-shell {
    padding: 54px 0 70px;
}

.page-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 30px;
    margin-bottom: 24px;
}

.page-heading.compact {
    align-items: center;
}

.page-heading h1,
.checkout-card h1,
.status-card h1 {
    margin: 4px 0 8px;
    letter-spacing: -0.035em;
}

.page-heading h1 {
    font-size: clamp(30px, 4vw, 42px);
}

.page-heading p,
.lead {
    margin: 0;
    color: var(--muted);
    line-height: 1.6;
}

.eyebrow {
    display: inline-block;
    font-size: 11px;
    letter-spacing: 0.14em;
    font-weight: 800;
    color: #778296;
}

.panel,
.checkout-card,
.summary-card,
.status-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 22px;
    box-shadow: var(--shadow);
}

.panel {
    overflow: hidden;
}

.form-panel {
    padding: 28px;
}

.btn {
    min-height: 44px;
    border-radius: 11px;
    border: 1px solid transparent;
    padding: 10px 17px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: 700;
    cursor: pointer;
    transition: transform .15s ease, background .15s ease, border .15s ease;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-light {
    border-color: var(--border);
    background: white;
    color: #344054;
}

.btn-sm {
    min-height: 36px;
    padding: 7px 12px;
    font-size: 13px;
}

.empty-state {
    padding: 70px 30px;
    text-align: center;
}

.empty-state h2 {
    margin: 10px 0 5px;
}

.empty-state p {
    color: var(--muted);
    margin: 0 0 20px;
}

.empty-icon {
    width: 54px;
    height: 54px;
    margin: auto;
    border-radius: 16px;
    display: grid;
    place-items: center;
    background: #edf4ff;
    color: var(--primary);
    font-size: 24px;
}

.table-wrap {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 850px;
}

.data-table th,
.data-table td {
    padding: 16px 18px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: middle;
}

.data-table th {
    font-size: 12px;
    color: var(--muted);
    letter-spacing: .025em;
    background: #fafbfc;
}

.data-table tbody tr:last-child td {
    border-bottom: 0;
}

.data-table td small {
    display: block;
    color: var(--muted);
    margin-top: 4px;
}

.text-right {
    text-align: right !important;
}

.badge {
    display: inline-flex;
    border-radius: 999px;
    padding: 6px 9px;
    font-weight: 800;
    font-size: 11px;
    letter-spacing: .02em;
}

.badge-success {
    color: var(--success);
    background: var(--success-bg);
}

.badge-pending {
    color: var(--warning);
    background: var(--warning-bg);
}

.back-link {
    display: inline-block;
    color: var(--muted);
    font-weight: 700;
    font-size: 14px;
    margin-bottom: 22px;
}

.form-grid {
    display: grid;
    gap: 18px;
}

.form-grid.two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.field {
    margin-bottom: 18px;
}

.field label,
.link-box label {
    display: block;
    font-size: 13px;
    font-weight: 800;
    margin-bottom: 7px;
}

.field input,
.field textarea,
.link-box input,
.money-input {
    width: 100%;
    border: 1px solid #d7dce6;
    border-radius: 11px;
    background: white;
    outline: none;
    color: var(--text);
}

.field input,
.field textarea,
.link-box input {
    padding: 12px 13px;
}

.field input:focus,
.field textarea:focus,
.link-box input:focus {
    border-color: #8bb8f5;
    box-shadow: 0 0 0 4px rgba(23, 105, 224, 0.09);
}

.field span.field-validation-error,
.validation-summary {
    display: block;
    color: var(--danger);
    font-size: 12px;
    margin-top: 6px;
}

.validation-summary ul {
    padding-left: 20px;
}

.help {
    color: var(--muted);
    display: block;
    margin-top: 6px;
}

.amount-card {
    background: #f8faff;
    border: 1px solid #e2e9f7;
    border-radius: 16px;
    padding: 20px;
}

.amount-title {
    font-size: 14px;
    font-weight: 800;
    margin-bottom: 16px;
}

.money-input {
    display: flex;
    align-items: center;
}

.money-input > span {
    padding-left: 13px;
    color: var(--muted);
    font-weight: 700;
}

.money-input input {
    border: 0;
    box-shadow: none !important;
}

.money-input.emphasis {
    border-color: #9fc2f6;
    background: #fbfdff;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 26px;
}

.link-box {
    padding-bottom: 22px;
    border-bottom: 1px solid var(--border);
}

.copy-row {
    display: flex;
    gap: 10px;
}

.copy-row input {
    min-width: 0;
}

.summary-list {
    padding-top: 10px;
}

.summary-list > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 13px 0;
    border-bottom: 1px solid var(--border);
}

.summary-list span {
    color: var(--muted);
}

.checkout-shell {
    padding: 54px 20px 70px;
}

.checkout-grid {
    width: min(1080px, 100%);
    margin: 0 auto;
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(320px, .8fr);
    gap: 24px;
    align-items: start;
}

.checkout-card {
    padding: clamp(25px, 5vw, 44px);
}

.checkout-topline {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: center;
}

.checkout-card h1 {
    font-size: clamp(34px, 5vw, 50px);
    margin-top: 18px;
}

.customer-box {
    margin: 30px 0 22px;
    padding: 16px;
    border-radius: 15px;
    background: #f7f9fc;
    display: flex;
    align-items: center;
    gap: 13px;
}

.customer-avatar {
    width: 42px;
    height: 42px;
    border-radius: 13px;
    display: grid;
    place-items: center;
    background: #e9f1ff;
    color: var(--primary);
    font-weight: 900;
}

.customer-box > div:last-child {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.customer-box span,
.trust-list small {
    color: var(--muted);
}

.trust-list {
    margin: 22px 0 28px;
}

.trust-list > div {
    display: flex;
    gap: 12px;
    padding: 11px 0;
}

.trust-list > div > div {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.trust-icon {
    flex: 0 0 28px;
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    background: #eef8f2;
    color: var(--success);
    border-radius: 9px;
    font-weight: 900;
}

.btn-pay {
    width: 100%;
    min-height: 58px;
    justify-content: space-between;
    background: linear-gradient(135deg, #1769e0, #4c63e7);
    color: white;
    border: 0;
    font-size: 16px;
    padding: 0 20px;
    box-shadow: 0 14px 30px rgba(23, 105, 224, 0.23);
}

.btn-pay:hover {
    background: linear-gradient(135deg, #0f5bc8, #4054cf);
}

.checkout-note {
    margin: 15px 0 0;
    color: var(--muted);
    text-align: center;
    font-size: 12px;
    line-height: 1.5;
}

.summary-card {
    padding: 28px;
    position: sticky;
    top: 24px;
}

.summary-card h2 {
    font-size: 24px;
    margin: 8px 0 18px;
}

.summary-description {
    background: #f7f9fc;
    border-radius: 13px;
    padding: 14px;
    color: #4a566b;
    line-height: 1.5;
    margin-bottom: 22px;
}

.summary-line,
.summary-total {
    display: flex;
    justify-content: space-between;
    gap: 15px;
}

.summary-line {
    padding: 10px 0;
    color: #3c475b;
}

.summary-line.muted {
    color: var(--muted);
}

.summary-total {
    border-top: 1px solid var(--border);
    margin-top: 10px;
    padding-top: 19px;
    align-items: end;
}

.summary-total strong {
    font-size: 25px;
    letter-spacing: -0.02em;
}

.powered {
    border-top: 1px solid var(--border);
    margin-top: 24px;
    padding-top: 18px;
    display: flex;
    justify-content: space-between;
    color: var(--muted);
    font-size: 12px;
}

.powered strong {
    color: #172033;
}

.alert {
    border-radius: 13px;
    padding: 14px;
    margin: 20px 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.alert-error {
    color: var(--danger);
    background: var(--danger-bg);
    border: 1px solid #ffd5d2;
}

.status-shell {
    min-height: calc(100vh - 160px);
    display: grid;
    place-items: center;
    padding: 50px 20px;
}

.status-card {
    width: min(620px, 100%);
    padding: clamp(30px, 6vw, 54px);
    text-align: center;
}

.status-card h1 {
    font-size: clamp(30px, 5vw, 42px);
}

.status-card p {
    color: var(--muted);
    line-height: 1.65;
}

.spinner {
    width: 52px;
    height: 52px;
    margin: 0 auto 22px;
    border-radius: 50%;
    border: 4px solid #e5ecf6;
    border-top-color: var(--primary);
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.success-icon {
    width: 66px;
    height: 66px;
    margin: 0 auto 22px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--success-bg);
    color: var(--success);
    font-size: 30px;
    font-weight: 900;
}

.receipt {
    margin: 28px 0;
    border: 1px solid var(--border);
    border-radius: 15px;
    overflow: hidden;
    text-align: left;
}

.receipt > div {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
}

.receipt > div:last-child {
    border-bottom: 0;
}

.receipt span {
    color: var(--muted);
}

.muted-text {
    color: var(--muted);
    font-size: 13px;
}

.mono {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 12px;
    word-break: break-all;
}

@media (max-width: 780px) {
    .checkout-grid {
        grid-template-columns: 1fr;
    }

    .order-summary {
        order: -1;
    }

    .summary-card {
        position: static;
    }

    .page-heading,
    .page-heading.compact {
        align-items: stretch;
        flex-direction: column;
    }

    .form-grid.two {
        grid-template-columns: 1fr;
    }

    .copy-row {
        flex-direction: column;
    }

    .secure-pill {
        display: none;
    }

    .container,
    .container-narrow {
        width: min(100% - 28px, 1180px);
    }
}
