:root {
    color-scheme: light;
    --bg: #f4f6f8;
    --card: #ffffff;
    --text: #131722;
    --muted: #687083;
    --line: #e2e6ec;
    --primary: #111827;
    --primary-hover: #000000;
    --success: #14804a;
    --success-bg: #e9f8ef;
    --danger: #b42318;
    --danger-bg: #fff0ee;
    --warning: #8a5a00;
    --warning-bg: #fff7df;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); }
a { color: inherit; }
.topbar {
    height: 68px; display: flex; align-items: center; justify-content: space-between;
    padding: 0 28px; background: rgba(255,255,255,.9); border-bottom: 1px solid var(--line);
    position: sticky; top: 0; z-index: 20; backdrop-filter: blur(12px);
}
.brand { font-weight: 750; text-decoration: none; letter-spacing: -.02em; }
.settings-link { text-decoration: none; font-weight: 650; font-size: 14px; }
.settings-link.active { color: var(--muted); }
.payment-total { font-weight: 800; }
.page { width: min(100% - 32px, 960px); margin: 0 auto; padding: 54px 0; }
.center-page { display: grid; place-items: center; gap: 16px; min-height: calc(100vh - 68px); align-content: center; }
.narrow-page { width: min(100% - 32px, 620px); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 22px; box-shadow: 0 18px 50px rgba(18,28,45,.06); }
.payment-card, .settings-card, .result-card { width: 100%; padding: 36px; }
.payment-card { max-width: 560px; }
.result-card { max-width: 600px; text-align: center; }
.eyebrow { font-size: 12px; font-weight: 850; letter-spacing: .14em; color: var(--muted); margin-bottom: 8px; }
h1 { font-size: clamp(30px, 5vw, 42px); line-height: 1.1; margin: 0 0 10px; letter-spacing: -.04em; }
.muted { color: var(--muted); line-height: 1.6; }
.small { font-size: 12px; }
.alert { border-radius: 12px; padding: 12px 14px; margin: 22px 0; font-size: 14px; }
.alert.warning { background: var(--warning-bg); color: var(--warning); }
.alert.danger { background: var(--danger-bg); color: var(--danger); }
.alert.success { background: var(--success-bg); color: var(--success); }
.amount-form { margin-top: 28px; }
.amount-form label, .settings-form label > span { display: block; margin-bottom: 8px; font-weight: 700; font-size: 14px; }
.amount-input { position: relative; }
.amount-input input { width: 100%; height: 82px; padding: 0 70px 0 22px; border: 1px solid var(--line); border-radius: 16px; font-size: 32px; font-weight: 780; outline: none; background: #fbfcfd; }
.amount-input input:focus, .settings-form input:focus { border-color: #8d96a8; box-shadow: 0 0 0 4px rgba(17,24,39,.06); }
.amount-input span { position: absolute; right: 22px; top: 50%; transform: translateY(-50%); font-size: 26px; font-weight: 750; color: var(--muted); }
.button { display: inline-flex; justify-content: center; align-items: center; min-height: 48px; border: 0; border-radius: 12px; padding: 0 20px; font: inherit; font-weight: 750; text-decoration: none; cursor: pointer; transition: .15s ease; }
.button.primary { width: 100%; margin-top: 16px; background: var(--primary); color: white; }
.button.primary:hover { background: var(--primary-hover); transform: translateY(-1px); }
.button.secondary { background: #eef1f5; color: var(--text); }
.button:disabled { opacity: .5; cursor: not-allowed; transform: none !important; }
.test-info { display: grid; gap: 5px; padding-top: 22px; margin-top: 22px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.test-info strong { color: var(--text); }
.last-order { width: 100%; max-width: 560px; padding: 18px 20px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.last-order > div { display: grid; gap: 4px; }
.last-order code, .order-summary code, .iframe-head code { font-size: 11px; color: var(--muted); }
.settings-form { display: grid; gap: 18px; margin-top: 28px; }
.settings-form input[type="text"], .settings-form input:not([type]) , .settings-form input[type="password"] { width: 100%; height: 50px; padding: 0 14px; border: 1px solid var(--line); border-radius: 11px; outline: none; font: inherit; background: #fbfcfd; }
.settings-form label small { color: var(--muted); font-weight: 500; }
.toggle-row { display: flex !important; gap: 12px; align-items: flex-start; padding: 14px; border: 1px solid var(--line); border-radius: 12px; }
.toggle-row input { width: 18px; height: 18px; margin-top: 2px; }
.toggle-row span { margin: 0 !important; display: grid !important; gap: 3px; }
.toggle-row small { display: block; }
.iframe-page { width: min(100% - 24px, 1000px); margin: 0 auto; padding: 28px 0 60px; }
.iframe-head { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin: 0 8px 20px; }
.iframe-head h1 { font-size: 28px; margin: 0; }
.iframe-shell { overflow: hidden; background: white; border: 1px solid var(--line); border-radius: 18px; min-height: 680px; box-shadow: 0 16px 50px rgba(18,28,45,.06); }
.status-icon { width: 72px; height: 72px; margin: 0 auto 22px; border-radius: 50%; display: grid; place-items: center; font-size: 34px; font-weight: 900; }
.status-icon.waiting { background: #eef1f5; color: #596273; }
.status-icon.approved { background: var(--success-bg); color: var(--success); }
.status-icon.failed { background: var(--danger-bg); color: var(--danger); }
.order-summary { display: flex; justify-content: center; align-items: center; gap: 12px; flex-wrap: wrap; background: #f7f8fa; border-radius: 12px; padding: 14px; margin: 22px 0; }
.order-summary span { font-size: 20px; font-weight: 800; }
.result-card .button { margin: 7px 4px 0; width: auto; }
.status-box { margin-top: 18px; padding: 12px; border-radius: 10px; font-size: 13px; }
.status-box.approved { background: var(--success-bg); color: var(--success); }
.status-box.pending { background: var(--warning-bg); color: var(--warning); }
.details { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 18px 0; text-align: left; }
.details span { display: grid; gap: 4px; background: #f7f8fa; padding: 12px; border-radius: 10px; color: var(--muted); font-size: 12px; }
.details strong { color: var(--text); font-size: 14px; }
.hidden { display: none !important; }
@media (max-width: 640px) {
    .topbar { padding: 0 18px; }
    .page { padding: 28px 0; }
    .center-page { align-content: start; }
    .payment-card, .settings-card, .result-card { padding: 24px; border-radius: 17px; }
    .amount-input input { height: 72px; font-size: 27px; }
    .last-order { align-items: stretch; flex-direction: column; }
    .last-order .button { width: 100%; }
    .iframe-head { align-items: flex-start; flex-direction: column; }
    .details { grid-template-columns: 1fr; }
}
