:root {
  color-scheme: dark;
  --bg: #070a10;
  --panel: rgba(17, 21, 31, 0.92);
  --panel-strong: #121722;
  --line: rgba(126, 149, 180, 0.22);
  --text: #f5f8ff;
  --muted: #a7b3c7;
  --blue: #31b8ff;
  --blue-strong: #13a8f6;
  --yellow: #f4e619;
  --danger: #ff6b7a;
  --success: #4ee59a;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-width: 0;
  width: 100%;
  min-height: 100%;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 18% 12%, rgba(49, 184, 255, 0.18), transparent 30rem),
    radial-gradient(circle at 82% 0%, rgba(244, 230, 25, 0.1), transparent 26rem),
    linear-gradient(135deg, #06080d 0%, #0a101a 52%, #05070b 100%);
  color: var(--text);
}

body {
  min-height: 100vh;
}

button,
input {
  font: inherit;
}

a {
  color: inherit;
}

.checkout-shell {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 32px 18px;
}

.checkout-card {
  position: relative;
  width: min(100%, 980px);
  min-height: 640px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.06), transparent 34%),
    rgba(8, 11, 17, 0.9);
  box-shadow: 0 26px 70px rgba(0, 0, 0, 0.42);
}

.checkout-card::before {
  position: absolute;
  inset: 0;
  pointer-events: none;
  content: "";
  background: linear-gradient(90deg, rgba(49, 184, 255, 0.16), transparent 38%, rgba(244, 230, 25, 0.08));
  opacity: 0.55;
}

.brand-row {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 28px 32px 0;
}

.brand-row img {
  display: block;
  border-radius: 8px;
}

.brand-row span,
.brand-row strong {
  display: block;
}

.brand-row span {
  color: var(--muted);
  font-size: 13px;
}

.brand-row strong {
  font-size: 16px;
}

.state {
  position: relative;
  z-index: 1;
}

.state-loading,
.state-error,
.state-expired,
.state-processing,
.state-success,
.state-failed {
  display: grid;
  min-height: 520px;
  place-items: center;
  padding: 36px;
  text-align: center;
}

.state-loading p,
.state-error p,
.state-expired p,
.state-processing p,
.state-success p,
.state-failed p {
  max-width: 460px;
  color: var(--muted);
  line-height: 1.6;
}

.loader,
.button-loader {
  width: 34px;
  height: 34px;
  border: 3px solid rgba(255, 255, 255, 0.16);
  border-top-color: var(--blue);
  border-radius: 999px;
  animation: spin 0.75s linear infinite;
}

.button-loader {
  display: none;
  width: 18px;
  height: 18px;
  border-width: 2px;
  border-top-color: #07111b;
}

.status-badge {
  display: grid;
  width: 70px;
  height: 70px;
  place-items: center;
  border-radius: 999px;
  font-size: 38px;
  font-weight: 800;
}

.status-badge-success {
  border: 1px solid rgba(78, 229, 154, 0.5);
  background: rgba(78, 229, 154, 0.12);
  color: var(--success);
}

.status-badge-danger {
  border: 1px solid rgba(255, 107, 122, 0.48);
  background: rgba(255, 107, 122, 0.12);
  color: var(--danger);
}

.status-badge-muted {
  border: 1px solid rgba(167, 179, 199, 0.42);
  background: rgba(167, 179, 199, 0.1);
  color: var(--muted);
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 14px;
}

.action-row .primary-button,
.action-row .secondary-button {
  min-width: 190px;
}

.checkout-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.75fr);
  gap: 22px;
  padding: 52px 32px 32px;
}

.payment-panel,
.invoice-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(9, 12, 18, 0.78);
  backdrop-filter: blur(18px);
}

.payment-panel {
  padding: 28px;
}

.invoice-panel {
  align-self: start;
  padding: 24px;
}

.back-link {
  display: inline-flex;
  margin-bottom: 24px;
  color: var(--muted);
  font-size: 14px;
  text-decoration: none;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 14px;
  font-size: clamp(32px, 5vw, 52px);
  line-height: 0.95;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 14px;
  font-size: 28px;
}

.lead {
  max-width: 600px;
  margin-bottom: 28px;
  color: var(--muted);
  line-height: 1.65;
}

.payment-form {
  display: grid;
  gap: 16px;
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

input {
  width: 100%;
  min-width: 0;
  border: 1px solid rgba(126, 149, 180, 0.24);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
  outline: none;
  padding: 16px 15px;
}

input:focus {
  border-color: rgba(49, 184, 255, 0.9);
  box-shadow: 0 0 0 4px rgba(49, 184, 255, 0.12);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.form-error {
  margin-bottom: 0;
  color: var(--danger);
  line-height: 1.5;
}

.pay-button,
.primary-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 58px;
  border: 0;
  border-radius: 8px;
  background: var(--blue);
  color: #03111b;
  cursor: pointer;
  font-weight: 800;
  text-decoration: none;
  transition: transform 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.pay-button {
  gap: 10px;
  margin-top: 6px;
  box-shadow: 0 18px 34px rgba(49, 184, 255, 0.22);
}

.pay-button:hover,
.primary-button:hover,
.secondary-button:hover {
  background: var(--blue-strong);
  transform: translateY(-1px);
}

.pay-button.is-processing {
  cursor: wait;
  opacity: 0.86;
}

.pay-button.is-processing .button-loader {
  display: block;
}

.secondary-button {
  margin-top: 16px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
}

.action-row .secondary-button {
  margin-top: 0;
  border: 1px solid rgba(126, 149, 180, 0.24);
}

.invoice-label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.price-row {
  display: grid;
  gap: 6px;
  margin: 18px 0 24px;
}

.price-row strong {
  font-size: 48px;
  line-height: 1;
}

.price-row span {
  color: var(--blue);
  font-weight: 800;
}

dl {
  display: grid;
  gap: 14px;
  margin: 0;
}

dl div {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  border-top: 1px solid rgba(126, 149, 180, 0.18);
  padding-top: 14px;
}

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

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

.secure-note {
  display: grid;
  gap: 8px;
  margin-top: 24px;
  border: 1px solid rgba(49, 184, 255, 0.28);
  border-radius: 8px;
  background: rgba(49, 184, 255, 0.09);
  padding: 16px;
}

.secure-note span {
  color: var(--muted);
  line-height: 1.5;
}

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

@media (max-width: 780px) {
  .checkout-shell {
    align-items: stretch;
    padding: 0;
  }

  .checkout-card {
    min-height: 100vh;
    border-width: 0;
    border-radius: 0;
  }

  .brand-row {
    padding: 22px 18px 0;
  }

  .checkout-grid {
    grid-template-columns: 1fr;
    padding: 34px 18px 22px;
  }

  .payment-panel,
  .invoice-panel {
    padding: 20px;
  }

  .invoice-panel {
    order: -1;
  }

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

  h1 {
    font-size: 38px;
  }
}
