:root {
  color-scheme: light;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #17304d;
  background: #eef6fb;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 10% 0%, rgba(56, 178, 218, .16), transparent 34rem),
    linear-gradient(180deg, #f8fcff, #eaf4fa);
}

.payment-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 20px 24px;
}

.payment-brand {
  color: #153b63;
  text-decoration: none;
  font-size: 20px;
  font-weight: 800;
}

.payment-secure {
  color: #347255;
  font-size: 14px;
  font-weight: 700;
}

.payment-layout {
  display: grid;
  grid-template-columns: minmax(260px, 360px) minmax(0, 1fr);
  gap: 22px;
  width: min(1180px, calc(100% - 32px));
  margin: 4px auto 32px;
}

.payment-card {
  background: #fff;
  border: 1px solid #dbe9f2;
  border-radius: 24px;
  box-shadow: 0 18px 50px rgba(34, 79, 112, .1);
}

.payment-info { padding: 28px; }
.payment-info h1 { margin: 0 0 12px; font-size: clamp(26px, 3vw, 38px); line-height: 1.08; }
.payment-info p { margin: 10px 0; color: #657a8f; line-height: 1.55; }

.payment-status {
  margin: 22px 0;
  padding: 16px;
  border-radius: 16px;
  background: #edf8ff;
  color: #205d86;
  font-weight: 750;
  line-height: 1.45;
}

.payment-status[data-tone="success"] { background: #e8f8ef; color: #167047; }
.payment-status[data-tone="error"] { background: #fff0ef; color: #a13a35; }

.payment-meta {
  display: grid;
  gap: 10px;
  margin: 0 0 22px;
  padding: 0;
  list-style: none;
  font-size: 14px;
  color: #4e657a;
}

.payment-meta strong { color: #17304d; }

.payment-order-details {
  display: grid;
  gap: 14px;
  margin: 0 0 22px;
}

.payment-order-details[hidden] { display: none; }

.payment-detail-section {
  padding: 14px;
  border: 1px solid #dbe9f2;
  border-radius: 18px;
  background: #f8fcff;
}

.payment-detail-title {
  margin: 0 0 10px;
  color: #17304d;
  font-size: 15px;
  font-weight: 900;
}

.payment-order-items {
  display: grid;
  gap: 10px;
}

.payment-order-item {
  display: grid;
  grid-template-columns: 54px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 8px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid #e3eef5;
}

.payment-order-thumb {
  width: 54px;
  height: 54px;
  overflow: hidden;
  border-radius: 12px;
  background: #edf4f8;
}

.payment-order-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.payment-order-name {
  display: block;
  color: #17304d;
  font-size: 13px;
  font-weight: 850;
  line-height: 1.25;
}

.payment-order-meta {
  display: block;
  margin-top: 3px;
  color: #657a8f;
  font-size: 12px;
}

.payment-order-sum {
  color: #17304d;
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}

.payment-total-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed #cddfea;
  color: #4e657a;
  font-size: 14px;
}

.payment-total-row strong {
  color: #17304d;
  font-size: 18px;
}

.payment-client-data {
  display: grid;
  gap: 8px;
  margin: 0;
}

.payment-client-data div {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
}

.payment-client-data dt {
  color: #7a8fa3;
  font-size: 12px;
  font-weight: 800;
}

.payment-client-data dd {
  margin: 0;
  color: #17304d;
  font-size: 13px;
  font-weight: 800;
  word-break: break-word;
}

.payment-actions { display: grid; gap: 10px; }

.payment-button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  border: 0;
  border-radius: 14px;
  background: #147fbd;
  color: #fff;
  text-decoration: none;
  font-weight: 800;
  cursor: pointer;
}

.payment-button[hidden] { display: none; }
.payment-button-secondary { background: #e9f2f8; color: #24516f; }

.payment-method-card { min-height: 700px; overflow: hidden; position: relative; }
.payment-method-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 18px 18px 0; padding: 6px; border-radius: 16px; background: #edf4f8; }
.payment-method-tabs[hidden] { display: none; }
.payment-method-tabs button { min-height: 44px; padding: 8px 14px; border: 0; border-radius: 11px; background: transparent; color: #597085; font: inherit; font-weight: 800; cursor: pointer; }
.payment-method-tabs button[aria-selected="true"] { background: #fff; color: #166f9f; box-shadow: 0 4px 14px rgba(37, 88, 119, .12); }
.payment-frame-placeholder { display: flex; min-height: 700px; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 32px; text-align: center; color: #657a8f; }
.payment-frame-placeholder[hidden] { display: none; }
.payment-frame-placeholder strong { color: #294c68; font-size: 18px; }
.payment-frame-placeholder small { font-size: 14px; }
.payment-loader { width: 42px; height: 42px; border: 4px solid #d9eaf3; border-top-color: #1681bb; border-radius: 50%; animation: payment-spin .8s linear infinite; }
@keyframes payment-spin { to { transform: rotate(360deg); } }
.qr-payment { display: flex; min-height: 625px; flex-direction: column; align-items: center; justify-content: center; padding: 26px 28px 34px; text-align: center; }
.qr-payment[hidden], .payment-frame-view[hidden] { display: none; }
.qr-badge { display: inline-flex; min-height: 30px; align-items: center; padding: 0 12px; border-radius: 999px; background: #e4f8ed; color: #107443; font-size: 13px; font-weight: 900; letter-spacing: .08em; }
.qr-payment h2 { margin: 14px 0 6px; color: #17304d; font-size: clamp(24px, 3vw, 34px); }
.qr-payment > p { max-width: 510px; margin: 0 0 18px; color: #657a8f; line-height: 1.5; }
.qr-code-shell { position: relative; width: min(350px, 84vw); padding: 15px; border: 1px solid #dbeaf2; border-radius: 24px; background: #fff; box-shadow: 0 14px 38px rgba(30, 80, 112, .12); }
.qr-code-shell img { display: block; width: 100%; height: auto; aspect-ratio: 1; }
.qr-corner { position: absolute; width: 34px; height: 34px; border-color: #1681bb; border-style: solid; }
.qr-corner-one { top: -3px; left: -3px; border-width: 4px 0 0 4px; border-radius: 18px 0 0; }
.qr-corner-two { top: -3px; right: -3px; border-width: 4px 4px 0 0; border-radius: 0 18px 0 0; }
.qr-corner-three { bottom: -3px; left: -3px; border-width: 0 0 4px 4px; border-radius: 0 0 0 18px; }
.qr-corner-four { right: -3px; bottom: -3px; border-width: 0 4px 4px 0; border-radius: 0 0 18px; }
.qr-payment .qr-hint { margin: 18px 0 10px; font-size: 13px; }
.qr-open-button { width: min(350px, 100%); }
.payment-frame-view { min-height: 632px; margin-top: 12px; }
.payment-frame { width: 100%; height: 700px; border: 0; background: #fff; }

.thanks-layout { min-height: calc(100vh - 84px); display: grid; place-items: center; padding: 24px; }
.thanks-card { width: min(640px, 100%); padding: 42px; text-align: center; }
.thanks-mark { display: grid; width: 72px; height: 72px; margin: 0 auto 22px; place-items: center; border-radius: 50%; background: #dff6e9; color: #148452; font-size: 38px; font-weight: 900; }
.thanks-card h1 { margin: 0 0 14px; font-size: clamp(30px, 5vw, 48px); }
.thanks-card p { color: #61778b; line-height: 1.6; }

@media (max-width: 820px) {
  .payment-layout { grid-template-columns: 1fr; }
  .payment-method-card, .payment-frame-placeholder { min-height: 620px; }
  .qr-payment { min-height: 545px; padding-inline: 18px; }
  .payment-method-tabs button { font-size: 13px; }
  .payment-frame { height: 620px; }
  .payment-client-data div { grid-template-columns: 1fr; gap: 2px; }
  .payment-order-item { grid-template-columns: 48px 1fr; }
  .payment-order-sum { grid-column: 2; }
}
