:root {
  --bg: #f5f6f3;
  --surface: #ffffff;
  --text: #171b16;
  --muted: #657064;
  --line: #d8ddd5;
  --line-strong: #b9c2b6;
  --accent: #ffd52e;
  --accent-hover: #ffca0a;
  --green: #237a4b;
  --error: #b42318;
  --warning: #8a5a00;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background: var(--bg);
}

button,
input {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
}

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

.checkout-panel {
  width: min(100%, 480px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 18px 45px rgba(23, 27, 22, 0.08);
}

.panel-header,
.product-summary,
.checkout-form,
.panel-footer {
  padding-right: 28px;
  padding-left: 28px;
}

.panel-header {
  display: flex;
  min-height: 66px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
}

.brand {
  font-size: 20px;
  font-weight: 850;
}

.secure-label {
  color: var(--green);
  font-size: 13px;
  font-weight: 750;
}

.product-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 22px;
  align-items: start;
  padding-top: 28px;
  padding-bottom: 26px;
}

.product-summary h1 {
  margin: 0;
  font-size: 25px;
  line-height: 1.2;
  letter-spacing: 0;
}

.product-summary p {
  max-width: 310px;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.unit-price {
  display: grid;
  justify-items: end;
  gap: 2px;
}

.unit-price strong {
  font-size: 20px;
}

.unit-price span {
  color: var(--muted);
  font-size: 12px;
}

.checkout-form {
  display: grid;
  gap: 20px;
  padding-top: 24px;
  padding-bottom: 24px;
  border-top: 1px solid var(--line);
}

.form-row,
.total-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.form-row > label {
  color: var(--text);
  font-size: 14px;
  font-weight: 750;
}

.quantity-control {
  display: grid;
  width: 172px;
  grid-template-columns: 44px minmax(72px, 1fr) 44px;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
}

.quantity-button {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 0;
  color: var(--text);
  background: #f7f8f6;
  font-size: 20px;
  font-weight: 700;
  cursor: pointer;
}

.quantity-button:hover:not(:disabled) {
  background: #eef1ec;
}

.quantity-button:disabled {
  color: #aeb5ac;
  cursor: not-allowed;
}

.quantity-control input {
  width: 100%;
  min-width: 0;
  height: 44px;
  border: 0;
  border-right: 1px solid var(--line);
  border-left: 1px solid var(--line);
  color: var(--text);
  background: var(--surface);
  text-align: center;
  font-size: 16px;
  font-weight: 750;
  outline: none;
  appearance: textfield;
}

.quantity-control input::-webkit-inner-spin-button,
.quantity-control input::-webkit-outer-spin-button {
  margin: 0;
  appearance: none;
}

.quantity-control:focus-within {
  border-color: #c49a00;
  box-shadow: 0 0 0 3px rgba(255, 213, 46, 0.25);
}

.total-row {
  border-top: 1px solid var(--line);
  padding-top: 20px;
  font-size: 16px;
}

.total-row strong {
  font-size: 26px;
}

.checkout-button {
  display: inline-flex;
  min-height: 54px;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border: 1px solid #d29f00;
  border-radius: 8px;
  padding: 0 18px;
  color: var(--text);
  background: var(--accent);
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.08);
  font-size: 16px;
  font-weight: 850;
  cursor: pointer;
}

.checkout-button:hover:not(:disabled) {
  background: var(--accent-hover);
}

.checkout-button:disabled {
  cursor: not-allowed;
  opacity: 0.56;
}

.message {
  min-height: 20px;
  margin: -8px 0 -4px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.message[data-tone="error"] {
  color: var(--error);
}

.message[data-tone="warning"] {
  color: var(--warning);
}

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

.config-notice {
  margin: 0 28px 24px;
  border: 1px solid #efd77c;
  border-radius: 8px;
  padding: 12px 14px;
  color: var(--warning);
  background: #fff9df;
  font-size: 12px;
  line-height: 1.5;
}

.config-notice code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.panel-footer {
  border-top: 1px solid var(--line);
  padding-top: 18px;
  padding-bottom: 18px;
  color: var(--muted);
  text-align: center;
  font-size: 12px;
  line-height: 1.6;
}

.panel-footer a {
  color: var(--text);
  font-weight: 700;
}

@media (max-width: 520px) {
  .checkout-page {
    align-items: start;
    padding: 16px 12px;
  }

  .panel-header,
  .product-summary,
  .checkout-form,
  .panel-footer {
    padding-right: 20px;
    padding-left: 20px;
  }

  .product-summary {
    gap: 14px;
  }

  .quantity-control {
    width: 160px;
    grid-template-columns: 42px minmax(68px, 1fr) 42px;
  }

  .quantity-button {
    width: 42px;
  }

  .config-notice {
    margin-right: 20px;
    margin-left: 20px;
  }
}
