:root {
  --maroon: #7a1b1b;
  --maroon-dark: #5a1010;
  --gold: #c9962b;
  --gold-light: #f6e7c1;
  --bg: #faf6ef;
  --card: #ffffff;
  --text: #1f1a17;
  --muted: #6b625b;
  --line: #e4dccf;
  --green: #1d7a3e;
  --green-bg: #e3f4e8;
  --red: #b42318;
  --red-bg: #fde8e6;
  --radius: 14px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: "Noto Sans Gujarati", "Noto Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 17px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
}

/* ---------- Header ---------- */
.hero {
  background: linear-gradient(160deg, var(--maroon) 0%, var(--maroon-dark) 100%);
  color: #fff;
  text-align: center;
  padding: 28px 18px 34px;
  border-bottom: 4px solid var(--gold);
}
.trophy { font-size: 44px; line-height: 1; }
.org { margin: 10px 0 2px; font-size: 15px; opacity: .92; }
.hero h1 { margin: 0; font-size: 28px; color: var(--gold-light); letter-spacing: .3px; }
.meta { margin: 10px 0 0; display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; font-size: 15px; }

/* ---------- Layout ---------- */
main { max-width: 560px; margin: 0 auto; padding: 16px 14px 32px; }

.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 18px 16px;
  margin-bottom: 14px;
  box-shadow: 0 1px 3px rgba(0,0,0,.06), 0 4px 14px rgba(122,27,27,.05);
  border: 1px solid var(--line);
}
.card h2 { margin: 0 0 14px; font-size: 19px; color: var(--maroon); display: flex; align-items: center; gap: 10px; }
.num {
  display: inline-grid; place-items: center;
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--gold); color: #fff; font-size: 15px; flex: none;
}
.intro { margin: 0 2px 14px; color: var(--muted); font-size: 15.5px; }
.help { margin: -6px 0 12px; color: var(--muted); font-size: 15px; }

/* ---------- Gate ---------- */
.gate { text-align: center; }
.gate h2 { display: block; font-size: 21px; }
.gate h2 small { font-size: 16px; color: var(--muted); font-weight: 600; }
.gate-btn {
  display: flex; flex-direction: column; align-items: center; width: 100%;
  margin-top: 12px; padding: 18px; border-radius: var(--radius);
  border: 2px solid var(--gold); background: #fffaf0; color: var(--maroon);
  font: inherit; cursor: pointer;
}
.gate-btn:active { transform: scale(.98); }
.gate-btn .big { font-size: 21px; font-weight: 700; }
.gate-btn .hint { font-size: 14px; color: var(--muted); }

/* ---------- Fields ---------- */
.field { margin-bottom: 16px; }
.field:last-child { margin-bottom: 0; }
.label { display: block; font-weight: 600; margin-bottom: 6px; }
.label em { font-style: normal; font-weight: 400; color: var(--muted); font-size: 14px; }

input[type=text], input[type=tel], textarea, select {
  width: 100%;
  font: inherit;
  font-size: 17px; /* >=16px prevents iOS zoom */
  padding: 12px 14px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  appearance: none;
  -webkit-appearance: none;
}
select {
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%;
  background-size: 6px 6px;
  background-repeat: no-repeat;
}
textarea { resize: vertical; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(201,150,43,.25); }

.sub { border-left: 3px solid var(--gold-light); padding-left: 12px; margin-top: 4px; }

/* Choice chips (radio buttons styled as big buttons) */
.choices { display: grid; gap: 8px; }
.choices.two { grid-template-columns: 1fr 1fr; }
.choice { position: relative; display: block; cursor: pointer; }
.choice input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.choice span {
  display: flex; align-items: center; min-height: 50px;
  padding: 10px 14px 10px 42px;
  border: 1.5px solid var(--line); border-radius: 10px;
  background: #fff; position: relative; font-weight: 500;
}
.choice span::before {
  content: ""; position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  width: 18px; height: 18px; border-radius: 50%; border: 2px solid #b9ae9f; background: #fff;
}
.choice input:checked + span { border-color: var(--maroon); background: #fbf1ef; color: var(--maroon); font-weight: 600; }
.choice input:checked + span::before { border-color: var(--maroon); background: radial-gradient(circle, var(--maroon) 45%, #fff 50%); }
.choice input:focus-visible + span { box-shadow: 0 0 0 3px rgba(201,150,43,.35); }

/* Received / Not received toggles */
.item { padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: #fffdf9; }
.item .label { display: flex; align-items: center; gap: 8px; font-size: 17.5px; }
.item .icon { font-size: 22px; }
.seg .choice span { justify-content: center; padding: 10px 8px; }
.seg .choice span::before { display: none; }
.seg .yes input:checked + span { background: var(--green-bg); border-color: var(--green); color: var(--green); }
.seg .no input:checked + span { background: var(--red-bg); border-color: var(--red); color: var(--red); }
.seg .yes span::after { content: " ✓"; white-space: pre; }
.seg .no span::after { content: " ✗"; white-space: pre; }

.check { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; font-weight: 500; }
.check input { width: 22px; height: 22px; margin: 2px 0 0; flex: none; accent-color: var(--maroon); }

.pending-box { background: var(--red-bg); color: var(--red); padding: 10px 12px; border-radius: 10px; margin: -4px 0 14px; }
.note { font-size: 15px; background: var(--gold-light); padding: 10px 12px; border-radius: 10px; margin: 12px 0 0; }
.note.muted { background: transparent; padding: 0; color: var(--muted); font-size: 14px; }
.muted { color: var(--muted); }

/* Errors */
.err { display: none; color: var(--red); font-size: 14.5px; margin: 6px 0 0; }
.invalid .err { display: block; }
.invalid input[type=text], .invalid input[type=tel], .invalid textarea, .invalid select, .invalid .choice span { border-color: var(--red); }

/* Buttons */
.btn {
  display: block; width: 100%; padding: 15px; margin-top: 18px;
  font: inherit; font-size: 18px; font-weight: 700;
  border-radius: 12px; border: 0; cursor: pointer;
}
.btn.primary { background: var(--maroon); color: #fff; box-shadow: 0 4px 12px rgba(122,27,27,.3); }
.btn.primary:active { background: var(--maroon-dark); }
.btn.secondary { background: #fff; color: var(--maroon); border: 2px solid var(--maroon); }
.btn[disabled] { opacity: .65; cursor: wait; }

/* Success */
.success { text-align: center; }
.success h2 { display: block; }
.tick { font-size: 52px; }
.ref-label { margin: 8px 0 0; color: var(--muted); }
.ref { font-size: 30px; font-weight: 700; color: var(--maroon); letter-spacing: 1px; margin: 2px 0 14px; }
.summary { text-align: left; background: #fffaf0; border: 1px dashed var(--gold); border-radius: 12px; padding: 12px 14px; margin-bottom: 12px; }
.summary p { margin: 4px 0; }

/* Banners & toast */
.banner { border-radius: 10px; padding: 10px 12px; margin-bottom: 12px; font-size: 14.5px; }
.banner.warn { background: #fff4d6; border: 1px solid #f0c75e; }
.banner.info { background: #e8f1fd; border: 1px solid #a9c8f0; }
.toast {
  position: fixed; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  width: calc(100% - 28px); max-width: 520px;
  background: #2b2522; color: #fff; padding: 13px 16px; border-radius: 12px;
  box-shadow: 0 6px 20px rgba(0,0,0,.25); font-size: 15.5px; z-index: 10;
  pointer-events: none; /* never block taps on the form underneath */
}

.hp { position: absolute; left: -9999px; height: 0; width: 0; opacity: 0; }

footer { text-align: center; color: var(--muted); font-size: 14px; padding: 6px 16px 28px; }
footer a { color: var(--maroon); font-weight: 600; }
footer p { margin: 4px 0; }

[hidden] { display: none !important; }

@media (min-width: 600px) {
  main { padding-top: 24px; }
  .card { padding: 22px 22px; }
}
