:root {
  --indigo: #34159E;
  --indigo-deep: #2a107f;
  --indigo-soft: rgba(255, 255, 255, 0.10);
  --line: rgba(255, 255, 255, 0.55);
  --line-strong: #ffffff;
  --red-1: #f5564a;
  --red-2: #e4271b;
  --radius: 999px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--indigo);
  color: #fff;
  font-family: 'Kanit', 'Segoe UI', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.stage {
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 32px 16px 56px;
}

/* ---------- Screens ---------- */
.screen { display: none; width: 100%; max-width: 460px; }
.screen.is-active { display: flex; flex-direction: column; align-items: center; }

.screen--welcome {
  min-height: calc(100vh - 88px);
  justify-content: center;
  gap: 56px;
}

/* ---------- Brand ---------- */
.brand { text-align: center; }
.brand__logo { display: block; margin: 0 auto; }
.brand--lg .brand__logo { width: min(72vw, 340px); }
.brand--lg .brand__event { font-size: clamp(28px, 8vw, 46px); }
.brand--sm .brand__logo { width: 190px; }
.brand--sm .brand__event { font-size: 26px; }
.brand__event {
  margin: 10px 0 0;
  font-family: 'Poppins', 'Kanit', sans-serif;
  font-weight: 400;
  letter-spacing: .5px;
}

/* ---------- Image buttons (real PNG assets) ---------- */
.btn-img {
  border: 0;
  background: none;
  padding: 0;
  cursor: pointer;
  line-height: 0;
  transition: transform .12s ease, filter .12s ease, opacity .12s ease;
}
.btn-img img { display: block; width: 100%; height: 100%; }
.btn-img:hover { transform: translateY(-2px); filter: brightness(1.04); }
.btn-img:active { transform: translateY(0); }
.btn-img:disabled { opacity: .6; cursor: progress; transform: none; }

/* REGISTER button (welcome) */
.btn-register { width: min(78vw, 300px); }

/* ---------- Form ---------- */
.screen--form { gap: 0; }
.reg-form { width: 100%; margin-top: 22px; }

.field { margin-bottom: 16px; }
.field > label,
.group-label {
  display: block;
  font-size: 14px;
  font-weight: 300;
  margin-bottom: 7px;
  color: rgba(255, 255, 255, .92);
}
.group-label i { font-size: 12px; opacity: .8; font-weight: 300; }

.field input[type="text"],
.field input[type="tel"],
.field input[type="email"],
.field select {
  width: 100%;
  height: 42px;
  padding: 0 16px;
  font-family: inherit;
  font-size: 15px;
  color: #fff;
  background: var(--indigo-soft);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  outline: none;
  transition: border-color .15s ease, background .15s ease;
}
.field select { -webkit-appearance: none; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23fff' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 18px center;
  padding-right: 40px;
  cursor: pointer;
}
.field select option { color: #1a1a1a; }
.field input::placeholder { color: rgba(255, 255, 255, .5); }
.field input:focus,
.field select:focus { border-color: var(--line-strong); background: rgba(255, 255, 255, .16); }
.field input.invalid,
.field select.invalid { border-color: #ff7b7b; }

/* checkbox / radio groups */
.options { display: flex; flex-wrap: wrap; gap: 10px 28px; padding: 4px 2px; }
.options--grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 18px; }
.opt {
  display: flex; align-items: center; gap: 9px;
  font-size: 14px; font-weight: 300; cursor: pointer; user-select: none;
}
.opt input { width: 17px; height: 17px; accent-color: var(--red-2); cursor: pointer; }

/* errors */
.err { display: block; min-height: 14px; margin-top: 4px; font-size: 12px; color: #ffb3b3; }
.form-error { min-height: 18px; margin: 4px 0 0; font-size: 13px; color: #ffb3b3; text-align: center; }

/* form actions */
.form-actions { display: flex; justify-content: space-between; align-items: center; gap: 18px; margin-top: 18px; }
.btn-cancel, .btn-ok { width: 150px; max-width: 42vw; }

/* ---------- Thank you ---------- */
.screen--thankyou { min-height: calc(100vh - 88px); justify-content: center; gap: 0; text-align: center; }
.thankyou-title {
  font-family: 'Poppins', sans-serif; font-weight: 800;
  font-size: clamp(40px, 12vw, 64px); letter-spacing: 4px; margin: 26px 0 2px;
  text-shadow: 0 3px 6px rgba(0, 0, 0, .35);
}
.thankyou-sub {
  margin: 2px 0 26px; font-size: clamp(20px, 5vw, 28px);
  font-weight: 500; opacity: .96;
}
.qr-wrap { background: #fff; padding: 14px; border-radius: 16px; box-shadow: 0 10px 30px rgba(0, 0, 0, .3); }
.qr-wrap img { display: block; width: 220px; height: 220px; }
.thankyou-note { margin: 22px 0 0; font-size: 13px; line-height: 1.6; opacity: .9; }
.thankyou-note i { font-weight: 300; opacity: .85; }
.thankyou-email { margin: 10px 0 0; font-size: 13px; color: #b6ffcf; min-height: 16px; }

/* ---------- transitions ---------- */
.screen.is-active { animation: fade .35s ease both; }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

@media (max-width: 380px) {
  .options--grid { grid-template-columns: 1fr; }
  .btn-register { padding: 15px 48px; font-size: 23px; }
}
