:root {
  color-scheme: light;
  --bg: #f6f7f4;
  --surface: #ffffff;
  --text: #17201b;
  --muted: #66736b;
  --border: #dbe2dd;
  --accent: #0f766e;
  --accent-strong: #0b5f59;
  --danger: #b42318;
  --shadow: 0 24px 70px rgba(23, 32, 27, 0.12);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.08), transparent 42%),
    linear-gradient(315deg, rgba(161, 92, 7, 0.08), transparent 36%),
    var(--bg);
  color: var(--text);
}

button,
input,
select {
  font: inherit;
}

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

.payment-panel {
  width: min(100%, 620px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: clamp(28px, 6vw, 52px);
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--text);
  color: white;
  font-size: 18px;
  line-height: 1;
}

.headline-block {
  margin-top: 42px;
}

h1 {
  margin: 0;
  font-size: clamp(38px, 8vw, 64px);
  line-height: 0.98;
  letter-spacing: 0;
  word-break: keep-all;
}

.headline-block p {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.55;
}

.headline-block p:empty {
  display: none;
}

.payment-form {
  margin-top: 36px;
}

label {
  display: block;
  margin-bottom: 10px;
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
}

.input-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

input {
  width: 100%;
  min-width: 0;
  height: 52px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0 16px;
  color: var(--text);
  background: white;
  outline: none;
}

input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.14);
}

.quantity-row {
  display: grid;
  grid-template-columns: auto 90px 1fr;
  align-items: center;
  gap: 12px;
  margin-top: 18px;
}

.quantity-row label {
  margin: 0;
}

select {
  height: 46px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--text);
  background: white;
  outline: none;
}

select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.14);
}

#total-price {
  justify-self: end;
  font-size: 16px;
}

button {
  min-height: 52px;
  border: 0;
  border-radius: 8px;
  padding: 0 18px;
  background: var(--accent);
  color: white;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}

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

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

.form-error {
  min-height: 22px;
  margin: 10px 0 0;
  color: var(--danger);
  font-size: 14px;
  line-height: 1.45;
}

.config-warning {
  margin-top: 26px;
  border-radius: 8px;
  padding: 18px;
}

.config-warning[hidden] {
  display: none;
}

.config-warning {
  background: rgba(161, 92, 7, 0.08);
  border: 1px solid rgba(161, 92, 7, 0.24);
  color: #733f05;
  font-size: 14px;
  line-height: 1.5;
}

.result-panel {
  max-width: 560px;
}

.result-headline {
  margin-top: 34px;
}

.result-kicker {
  margin: 0 0 18px;
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.4;
}

.result-panel.is-problem .result-kicker {
  color: var(--danger);
}

.result-panel h1 {
  font-size: clamp(32px, 5.5vw, 46px);
  line-height: 1.06;
}

.result-meta {
  display: grid;
  gap: 0;
  margin: 30px 0 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.result-meta-row {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 0;
}

.result-meta-row + .result-meta-row {
  border-top: 1px solid var(--border);
}

.result-meta dt,
.result-meta dd {
  margin: 0;
  font-size: 14px;
  line-height: 1.45;
}

.result-meta dt {
  color: var(--muted);
  font-weight: 700;
}

.result-meta dd {
  color: var(--text);
  font-weight: 800;
  text-align: right;
  word-break: break-all;
}

.result-detail {
  margin: 20px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.secondary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  margin-top: 24px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0 16px;
  background: white;
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
}

.secondary-action:hover {
  border-color: var(--accent);
  background: rgba(15, 118, 110, 0.08);
  color: var(--accent-strong);
}

button.secondary-action:hover:not(:disabled) {
  border-color: var(--accent);
  background: rgba(15, 118, 110, 0.08);
  color: var(--accent-strong);
}

@media (max-width: 640px) {
  .app-shell {
    align-items: start;
  }

  .payment-panel {
    padding: 28px 20px;
  }

  .headline-block {
    margin-top: 34px;
  }

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

  .quantity-row {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  #total-price {
    justify-self: start;
  }

  button {
    width: 100%;
  }

  .secondary-action {
    width: 100%;
  }
}
