:root {
    color-scheme: light;
    --purple: #6341ac;
    --orange: #f28410;
    --ink: #171423;
    --muted: #686274;
    --line: #e6e1ee;
    --paper: #ffffff;
    --wash: #f8f6fc;
    --success-bg: #ecfdf3;
    --success: #067647;
    --error-bg: #fef3f2;
    --error: #b42318;
}

* {
    box-sizing: border-box;
}

body {
    min-height: 100vh;
    margin: 0;
    display: grid;
    place-items: center;
    padding: 24px;
    font-family: Arial, Helvetica, sans-serif;
    color: var(--ink);
    background:
        radial-gradient(circle at top left, rgba(242, 132, 16, 0.16), transparent 34%),
        linear-gradient(135deg, #ffffff 0%, var(--wash) 100%);
}

.checkout {
    width: min(940px, 100%);
    display: grid;
    grid-template-columns: 0.9fr 1.1fr;
    border: 1px solid var(--line);
    border-radius: 18px;
    overflow: hidden;
    background: var(--paper);
    box-shadow: 0 24px 70px rgba(50, 35, 82, 0.16);
}

.admin-shell {
    width: min(1180px, 100%);
    grid-template-columns: 0.72fr 1.28fr;
}

.brand-panel,
.payment-card {
    padding: 34px;
}

.brand-panel {
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: linear-gradient(160deg, var(--purple), #432879);
    color: white;
}

.logo {
    width: 188px;
    max-width: 100%;
    height: auto;
    padding: 12px 14px;
    border-radius: 12px;
    background: white;
}

h1 {
    margin: 42px 0 12px;
    font-size: 40px;
    line-height: 1.05;
    letter-spacing: 0;
}

p {
    margin: 0;
    color: rgba(255, 255, 255, 0.82);
    line-height: 1.6;
}

.fee-note {
    width: max-content;
    min-width: 180px;
    display: flex;
    justify-content: space-between;
    gap: 24px;
    margin-top: 34px;
    padding: 14px 16px;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.1);
}

.fee-note span {
    color: rgba(255, 255, 255, 0.76);
}

.fee-note strong {
    color: #ffd7ad;
}

.side-actions {
    display: grid;
    gap: 12px;
    margin-top: 16px;
}

.side-link {
    width: max-content;
    color: white;
    font-weight: 800;
    text-decoration: none;
    border-bottom: 2px solid rgba(255, 255, 255, 0.55);
}

.side-link:hover {
    border-bottom-color: white;
}

.text-link {
    color: var(--purple);
    font-weight: 800;
    text-decoration: none;
    border-bottom: 2px solid rgba(99, 65, 172, 0.25);
}

.text-link:hover {
    border-bottom-color: var(--purple);
}

.payment-card {
    display: grid;
    align-content: center;
    gap: 24px;
}

.admin-card {
    align-content: start;
}

form {
    display: grid;
    gap: 12px;
}

label {
    color: var(--muted);
    font-weight: 700;
    font-size: 14px;
}

.amount-row {
    display: grid;
    grid-template-columns: 1fr 78px;
}

input,
select,
button {
    min-height: 54px;
    font: inherit;
}

input {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 10px 0 0 10px;
    padding: 0 16px;
    color: var(--ink);
    font-size: 22px;
    font-weight: 700;
}

select,
.plain-input {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 0 14px;
    color: var(--ink);
    background: white;
    font-weight: 700;
}

input:focus {
    outline: 3px solid rgba(99, 65, 172, 0.16);
    border-color: var(--purple);
}

select:focus,
.plain-input:focus {
    outline: 3px solid rgba(99, 65, 172, 0.16);
    border-color: var(--purple);
}

.amount-row span {
    display: grid;
    place-items: center;
    border: 1px solid var(--line);
    border-left: 0;
    border-radius: 0 10px 10px 0;
    color: var(--purple);
    background: #f4f0fb;
    font-weight: 800;
}

button {
    margin-top: 6px;
    border: 0;
    border-radius: 10px;
    color: white;
    background: var(--orange);
    font-weight: 800;
    cursor: pointer;
}

button:hover {
    background: #dc7408;
}

.pay-now {
    margin-top: -8px;
    background: var(--purple);
}

.pay-now:hover {
    background: #51358f;
}

button:disabled {
    cursor: not-allowed;
    opacity: 0.65;
}

.mini-button {
    min-height: 34px;
    margin: 0;
    padding: 0 12px;
    border-radius: 8px;
    font-size: 13px;
}

.fee-list {
    display: grid;
    gap: 0;
    margin: 0;
    border: 1px solid var(--line);
    border-radius: 12px;
    overflow: hidden;
}

.fee-list div {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--line);
}

.fee-list div:last-child {
    border-bottom: 0;
}

dt {
    color: var(--muted);
}

dd {
    margin: 0;
    text-align: right;
    font-weight: 800;
}

.total-row {
    background: #fbf8ff;
}

.total-row dd {
    color: var(--purple);
}

.status-box {
    display: none;
    padding: 13px 15px;
    border-radius: 10px;
    background: #f4f0fb;
    color: var(--purple);
    line-height: 1.45;
}

.status-box.show {
    display: block;
}

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

.status-box.error {
    background: var(--error-bg);
    color: var(--error);
}

.instruction-panel {
    display: grid;
    gap: 12px;
    padding: 16px;
    border: 1px solid rgba(99, 65, 172, 0.22);
    border-radius: 12px;
    background: #fbf8ff;
}

.instruction-panel[hidden] {
    display: none;
}

.instruction-panel h2 {
    margin: 0;
    color: var(--purple);
    font-size: 18px;
}

.instruction-panel dl {
    display: grid;
    gap: 8px;
    margin: 0;
}

.instruction-panel dl div {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 8px 0;
    border-bottom: 1px solid var(--line);
}

.instruction-panel dl div:last-child {
    border-bottom: 0;
}

.instruction-panel p {
    color: var(--muted);
    font-size: 14px;
}

.table-wrap {
    width: 100%;
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: 12px;
}

.admin-table {
    width: 100%;
    min-width: 760px;
    border-collapse: collapse;
    background: white;
}

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

.admin-table th {
    color: var(--muted);
    font-size: 13px;
}

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

.admin-table strong,
.admin-table span {
    display: block;
}

.admin-table span {
    margin-top: 4px;
    color: var(--muted);
    font-size: 13px;
}

.pill {
    width: max-content;
    padding: 6px 10px;
    border-radius: 999px;
    background: #f4f0fb;
    color: var(--purple);
    font-size: 12px;
    font-weight: 800;
}

.payload-preview {
    max-width: 420px;
    max-height: 220px;
    overflow: auto;
    margin: 0;
    padding: 10px;
    border-radius: 8px;
    background: #fbf8ff;
    color: var(--ink);
    font-size: 12px;
    line-height: 1.45;
    white-space: pre-wrap;
}

@media (max-width: 760px) {
    body {
        padding: 12px;
        place-items: start center;
    }

    .checkout,
    .admin-shell {
        grid-template-columns: 1fr;
    }

    .brand-panel,
    .payment-card {
        padding: 24px;
    }

    h1 {
        margin-top: 28px;
        font-size: 34px;
    }
}
