:root {
  --grass: #E4EFD6;
  --paper: #FFFDF6;
  --hedge: #1E3B26;
  --moss: #4F7A3A;
  --rule: #CBDBB8;
  --hay: #F3B63F;
  --hay-deep: #D9962A;
  --alert: #A2331F;
  color-scheme: light;
  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
*, *::before, *::after { box-sizing: inherit; }
html { background: var(--grass); }
body {
  margin: 0;
  font-family: "Bricolage Grotesque", ui-rounded, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-optical-sizing: auto;
  color: var(--hedge);
  background: var(--grass);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
.wrap { max-width: 30rem; margin: 0 auto; padding: 1.5rem 1rem 2.5rem; }

/* Brand */
.brand { text-align: center; margin-bottom: 1.25rem; }
.logo { display: block; max-width: 11rem; height: auto; margin: 0 auto 0.75rem; }
.wordmark { font-size: 2.4rem; font-weight: 800; line-height: 1; letter-spacing: -0.02em; margin: 0 0 0.6rem; }
.intro { margin: 0 auto; max-width: 24rem; color: var(--moss); font-size: 1.05rem; }

/* Ticket */
.ticket {
  position: relative;
  background: var(--paper);
  border-radius: 20px;
  padding: 1.5rem 1.25rem 1.25rem;
  box-shadow: 0 1px 0 var(--rule), 0 12px 30px -18px rgba(30, 59, 38, 0.45);
}
.block h2 { font-size: 1.15rem; font-weight: 800; margin: 0 0 0.9rem; }
.perf {
  position: relative;
  height: 2px;
  margin: 1.5rem -1.25rem;
  background-image: linear-gradient(to right, var(--rule) 55%, transparent 0);
  background-size: 12px 2px;
}
.perf::before, .perf::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--grass);
  transform: translateY(-50%);
}
.perf::before { left: -13px; }
.perf::after { right: -13px; }

/* Fields */
label { display: block; font-weight: 600; margin-bottom: 0.9rem; }
.opt { font-weight: 400; color: var(--moss); }
input {
  display: block;
  width: 100%;
  margin-top: 0.3rem;
  padding: 0.75rem 0.85rem;
  font: inherit;
  font-weight: 400;
  font-size: 1rem;
  color: var(--hedge);
  background: #fff;
  border: 2px solid var(--rule);
  border-radius: 12px;
}
input:focus { outline: none; border-color: var(--moss); box-shadow: 0 0 0 3px rgba(79, 122, 58, 0.2); }
input[aria-invalid="true"] { border-color: var(--alert); }
.hint { display: block; font-weight: 400; font-size: 0.9rem; color: var(--moss); margin-top: 0.3rem; }

/* Items */
.items { list-style: none; margin: 0; padding: 0; }
.item {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--rule);
}
.item:first-child { padding-top: 0; }
.item-name { font-weight: 700; font-size: 1.05rem; }
.item-note { display: block; font-size: 0.9rem; color: var(--moss); }
.stepper { display: flex; align-items: center; gap: 0.25rem; }
.stepper button {
  width: 2.75rem; height: 2.75rem;
  font: inherit; font-size: 1.4rem; font-weight: 700; line-height: 1;
  color: var(--hedge);
  background: var(--grass);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  touch-action: manipulation;
}
.stepper button:disabled { opacity: 0.35; cursor: default; }
.stepper output { min-width: 2rem; text-align: center; font-size: 1.2rem; font-weight: 800; font-variant-numeric: tabular-nums; }

.totals { margin: 1rem 0 0; display: grid; grid-template-columns: 1fr auto; row-gap: 0.3rem; font-variant-numeric: tabular-nums; }
.totals dt { color: var(--moss); }
.totals dd { margin: 0; text-align: right; }
.totals .grand { font-size: 1.35rem; font-weight: 800; color: var(--hedge); padding-top: 0.5rem; }

/* Pay */
.error { margin: 1.25rem 0 0; padding: 0.75rem 0.9rem; border-radius: 12px; background: #FBE7E2; color: var(--alert); font-weight: 600; }
.pay {
  display: block;
  width: 100%;
  margin-top: 1.25rem;
  padding: 1rem;
  font: inherit;
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--hedge);
  background: var(--hay);
  border: none;
  border-radius: 14px;
  box-shadow: 0 4px 0 var(--hay-deep);
  cursor: pointer;
  transition: transform 0.08s, box-shadow 0.08s;
}
.pay:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--hay-deep); }
.pay:disabled { opacity: 0.6; cursor: progress; }
.secure { text-align: center; font-size: 0.9rem; color: var(--moss); margin: 0.75rem 0 0; }

:focus-visible { outline: 3px solid var(--moss); outline-offset: 2px; }

/* Footer */
footer { text-align: center; margin-top: 2rem; font-size: 0.9rem; color: var(--moss); }
footer strong { color: var(--hedge); font-weight: 700; }

/* Success page */
.stamp { text-align: center; }
.stamp-mark {
  display: inline-block;
  font-size: 2.6rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--moss);
  border: 4px solid var(--moss);
  border-radius: 14px;
  padding: 0.1rem 1.1rem;
  transform: rotate(-4deg);
  margin: 0.25rem 0 1rem;
}
.stamp-mark.pending { color: var(--hay-deep); border-color: var(--hay-deep); }
.stamp p { margin: 0 0 0.4rem; }
.ref { font-size: 1.6rem; font-weight: 800; letter-spacing: 0.08em; font-variant-numeric: tabular-nums; }
.back { display: block; text-align: center; margin-top: 1.25rem; color: var(--hedge); font-weight: 600; }

@media (prefers-reduced-motion: reduce) {
  .pay { transition: none; }
  .stamp-mark { transform: none; }
}
