:root {
  color-scheme: light dark;
  --paper: #e8e8e2;
  --paper-raised: #f4f3ed;
  --ink: #202420;
  --muted: #636862;
  --line: #aeb2ab;
  --accent: #b42f2f;
  --button-text: #f7f6ef;
  --shadow: rgba(48, 52, 48, 0.16);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--paper);
}

body {
  min-height: 100dvh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(
      circle at 18% 10%,
      rgba(255, 255, 255, 0.5),
      transparent 26%
    ),
    repeating-linear-gradient(
      0deg,
      transparent 0 31px,
      rgba(32, 36, 32, 0.025) 32px
    ),
    var(--paper);
  font-family: Arial, Helvetica, sans-serif;
}

button,
a {
  font: inherit;
}

button:focus-visible,
a:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 4px;
}

input:focus-visible {
  outline: none;
}

.page {
  width: min(1180px, calc(100% - 40px));
  min-height: calc(100dvh - 40px);
  margin: 20px auto;
  border: 1px solid var(--ink);
  background: color-mix(in srgb, var(--paper-raised) 96%, transparent);
  box-shadow: 14px 14px 0 var(--shadow);
}

.masthead {
  min-height: 76px;
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid var(--ink);
}

.brand {
  margin: 0;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.record {
  margin: 0;
  color: var(--muted);
  font-family: "Courier New", monospace;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-align: right;
  text-transform: uppercase;
}

main {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(360px, 0.85fr);
}

.left {
  min-width: 0;
  min-height: calc(100dvh - 118px);
  padding: clamp(36px, 6vw, 82px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 64px;
  border-right: 1px solid var(--ink);
}

.kicker,
.section-label {
  margin: 0 0 18px;
  color: var(--accent);
  font-family: "Courier New", monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1 {
  max-width: 720px;
  margin: 0;
  font-size: clamp(48px, 7vw, 94px);
  font-weight: 900;
  letter-spacing: -0.065em;
  line-height: 0.88;
  text-transform: uppercase;
}

.lead {
  max-width: 490px;
  margin: 28px 0 0;
  color: var(--muted);
  font-size: clamp(17px, 2vw, 21px);
  line-height: 1.45;
}

.free-box {
  position: relative;
  max-width: 600px;
  padding: 28px;
  border: 1px solid var(--ink);
  background: var(--paper-raised);
}

.free-box::after {
  content: "0Đ";
  position: absolute;
  top: -24px;
  right: 22px;
  width: 74px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border: 3px double var(--accent);
  border-radius: 50%;
  color: var(--accent);
  font-family: "Courier New", monospace;
  font-size: 22px;
  font-weight: 900;
  transform: rotate(9deg);
}

h2 {
  margin: 0;
  font-size: clamp(28px, 4vw, 48px);
  letter-spacing: -0.04em;
  line-height: 1;
}

.free-box p:not(.section-label) {
  max-width: 470px;
  margin: 16px 0 24px;
  color: var(--muted);
  line-height: 1.6;
}

.action {
  min-height: 54px;
  padding: 0 22px;
  border: 1px solid var(--ink);
  border-radius: 0;
  color: var(--button-text);
  background: var(--ink);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  transition:
    transform 160ms ease,
    background 160ms ease;
}

.action:hover {
  background: var(--accent);
}

.action:active {
  transform: translateY(2px);
}

.status {
  min-height: 20px;
  margin: 12px 0 0;
  color: var(--muted);
  font-family: "Courier New", monospace;
  font-size: 11px;
}

.qr-panel {
  min-width: 0;
  padding: clamp(30px, 4vw, 58px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  background:
    linear-gradient(rgba(180, 47, 47, 0.045), rgba(180, 47, 47, 0.045)),
    var(--paper-raised);
}

.qr-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.qr-heading h2 {
  max-width: 310px;
}

.stamp {
  flex: 0 0 94px;
  min-height: 60px;
  padding: 9px;
  display: grid;
  place-items: center;
  border: 3px double var(--accent);
  color: var(--accent);
  font-family: "Courier New", monospace;
  font-size: 10px;
  font-weight: 900;
  line-height: 1.15;
  text-align: center;
  text-transform: uppercase;
  transform: rotate(-7deg);
}

.qr-link {
  display: block;
  border: 1px solid var(--line);
  background: #f8f8f5;
}

.qr-link img {
  width: 100%;
  height: auto;
  display: block;
}

.amount-picker {
  margin: 0 0 20px;
  padding: 0;
  border: 0;
}

.amount-picker legend {
  margin-bottom: 10px;
  color: var(--muted);
  font-family: "Courier New", monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.amount-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.amount-option {
  min-height: 44px;
  border: 1px solid var(--ink);
  border-radius: 0;
  color: var(--ink);
  background: transparent;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.amount-option[aria-pressed="true"] {
  color: var(--button-text);
  background: var(--accent);
  border-color: var(--accent);
}

.amount-option:active {
  transform: translateY(2px);
}

.custom-amount {
  margin-top: 8px;
}

.custom-amount input {
  min-width: 0;
  min-height: 46px;
  width: 100%;
  padding: 0 12px;
  border: 1px solid var(--ink);
  border-radius: 0;
  color: var(--ink);
  background: var(--paper-raised);
  font: inherit;
}

.custom-amount input::placeholder {
  color: var(--muted);
  opacity: 1;
}

.custom-amount input[aria-invalid="true"] {
  border-color: var(--accent);
}

.amount-message {
  min-height: 18px;
  margin: 8px 0 0;
  color: var(--muted);
  font-family: "Courier New", monospace;
  font-size: 10px;
}

.amount-message[data-error="true"] {
  color: var(--accent);
  font-weight: 700;
}

.bank-line {
  margin: 20px 0 0;
  padding-top: 18px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 20px;
  border-top: 1px solid var(--ink);
  font-size: 13px;
}

.bank-line span {
  color: var(--muted);
}

.bank-line strong {
  text-align: right;
}

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

@media (max-width: 800px) {
  .page {
    width: min(100% - 24px, 620px);
    margin: 12px auto 26px;
    box-shadow: 8px 8px 0 var(--shadow);
  }

  .masthead {
    min-height: 64px;
    padding: 14px 16px;
  }

  main {
    grid-template-columns: 1fr;
  }

  .left {
    min-height: auto;
    padding: 42px 20px 52px;
    gap: 54px;
    border-right: 0;
    border-bottom: 1px solid var(--ink);
  }

  h1 {
    font-size: clamp(42px, 13vw, 68px);
  }

  .free-box {
    padding: 24px 20px;
  }

  .qr-panel {
    padding: 42px 20px;
  }
}

@media (max-width: 430px) {
  .record {
    display: none;
  }

  .qr-heading {
    display: block;
  }

  .stamp {
    width: 94px;
    margin: 20px 0 0 auto;
  }
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #1d211e;
    --paper-raised: #262b27;
    --ink: #ecece5;
    --muted: #b7bdb6;
    --line: #676d67;
    --accent: #f07c73;
    --button-text: #202420;
    --shadow: rgba(0, 0, 0, 0.32);
  }

  .qr-link {
    background: #f8f8f5;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
