/* ── Email-Gated Coupon Reveal — vintage carnival ticket booth ──────
   Crimson midway, cream scallop awning with string lights, circus
   slab headline, giant ADMIT ONE ticket with perforated stub that
   tears open on unlock, letterpress code and brass copy button. */

:root {
  --crimson: #8e1f23;
  --crimson-deep: #6b1417;
  --cream: #f6ead2;
  --cream-deep: #eddcba;
  --gold: #e0a93c;
  --gold-deep: #b98a26;
  --navy: #21344f;
  --ink-soft: rgba(246, 234, 210, 0.7);
  --err: #ffb09a;
  --circus: 'Rye', serif;
  --sans: 'Libre Franklin', sans-serif;
  --mono: 'IBM Plex Mono', monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

.hidden { display: none !important; }

body {
  font-family: var(--sans);
  color: var(--cream);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  background:
    repeating-linear-gradient(90deg, rgba(0, 0, 0, 0.1) 0 46px, transparent 46px 92px),
    linear-gradient(180deg, var(--crimson), var(--crimson-deep));
  background-attachment: fixed;
  min-height: 100vh;
}

.midway { min-height: 100vh; display: flex; flex-direction: column; }

.wrap { width: 100%; max-width: 560px; margin: 0 auto; padding: 0 24px; }

main { flex: 1 0 auto; padding-bottom: 60px; }

/* ── Awning ───────────────────────────────────────────────────────── */
.awning { position: relative; }

.scallops {
  height: 40px;
  background:
    radial-gradient(circle at 20px 0, var(--cream) 19px, transparent 20px),
    repeating-linear-gradient(90deg, var(--cream) 0 40px, var(--crimson-deep) 40px 80px);
  background-size: 40px 40px, 80px 40px;
  background-repeat: repeat-x;
}

.lights {
  display: flex;
  justify-content: space-around;
  margin-top: 8px;
  padding: 0 8%;
}

.lights span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 12px rgba(224, 169, 60, 0.9);
  animation: glow 1.6s ease-in-out infinite alternate;
}

.lights span:nth-child(2n) { animation-delay: 0.5s; }
.lights span:nth-child(3n) { animation-delay: 1s; }

@keyframes glow { from { opacity: 0.45; } to { opacity: 1; } }

/* ── Hero ─────────────────────────────────────────────────────────── */
.hero { text-align: center; padding: 30px 24px 6px; }

.kicker {
  font-weight: 700;
  font-size: 0.7rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 14px;
}

.hero h1 {
  font-family: var(--circus);
  font-weight: 400;
  font-size: clamp(1.9rem, 7.4vw, 3rem);
  line-height: 1.14;
  color: var(--cream);
  text-shadow: 0 3px 0 rgba(0, 0, 0, 0.3);
}

.gold { color: var(--gold); }

.sub { color: var(--ink-soft); max-width: 400px; margin: 14px auto 0; }

/* ── Ticket ───────────────────────────────────────────────────────── */
.ticket-stage { margin-top: 30px; }

.ticket {
  display: flex;
  background: var(--cream);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 20px 46px rgba(0, 0, 0, 0.45);
  border: 3px solid var(--gold);
}

.ticket-main {
  flex: 1;
  padding: 30px 26px 26px;
  color: var(--navy);
  text-align: center;
}

.admit {
  font-family: var(--circus);
  font-size: 1.25rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--crimson);
}

.medallion {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 96px;
  height: 96px;
  margin: 14px 0 8px;
  background: var(--crimson);
  clip-path: polygon(50% 0%, 60% 10%, 73% 5%, 77% 18%, 90% 18%, 88% 31%, 100% 37%, 92% 48%, 100% 60%, 89% 67%, 92% 80%, 79% 81%, 75% 94%, 62% 89%, 50% 100%, 38% 89%, 25% 94%, 21% 81%, 8% 80%, 11% 67%, 0% 60%, 8% 48%, 0% 37%, 12% 31%, 10% 18%, 23% 18%, 27% 5%, 40% 10%);
}

.medallion span {
  font-family: var(--circus);
  font-size: 1.9rem;
  color: var(--cream);
}

.medallion em { font-style: normal; font-size: 0.55em; }

.ticket-line {
  font-weight: 600;
  font-size: 0.82rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(33, 52, 79, 0.6);
  margin-bottom: 20px;
}

/* form */
.field { margin-bottom: 14px; text-align: left; }

label {
  display: block;
  font-weight: 700;
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin-bottom: 6px;
  color: var(--crimson);
}

input[type="email"] {
  width: 100%;
  padding: 13px 15px;
  font-family: var(--sans);
  font-size: 1rem;
  color: var(--navy);
  background: #fff;
  border: 2px solid var(--cream-deep);
  border-radius: 10px;
  transition: border-color 0.15s ease;
}

input:focus { outline: none; border-color: var(--crimson); }
input.error { border-color: #c43a2c; }
input::placeholder { color: #b9a982; }

/* ── Perforation + stub ───────────────────────────────────────────── */
.perf {
  flex: 0 0 3px;
  background-image: linear-gradient(180deg, rgba(33, 52, 79, 0.4) 0 8px, transparent 8px 16px);
  background-size: 3px 16px;
  margin: 12px 0;
}

.ticket-stub {
  flex: 0 0 140px;
  background: var(--cream-deep);
  padding: 24px 14px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: transform 0.6s ease;
}

.ticket.torn .ticket-stub { transform: rotate(4deg) translateX(6px); }

.stub-label {
  font-weight: 700;
  font-size: 0.62rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(33, 52, 79, 0.55);
}

.stub-lock {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 2.5px dashed rgba(33, 52, 79, 0.4);
  font-family: var(--circus);
  font-size: 1.6rem;
  color: rgba(33, 52, 79, 0.5);
}

.stub-code {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: 0.08em;
  color: var(--navy);
  background: #fff;
  border: 2px solid var(--navy);
  border-radius: 8px;
  padding: 8px 10px;
  word-break: break-all;
}

.copy-btn {
  font-family: var(--sans);
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--navy);
  background: linear-gradient(180deg, var(--gold), var(--gold-deep));
  border: none;
  border-radius: 999px;
  padding: 9px 16px;
  cursor: pointer;
  margin-top: 8px;
  transition: transform 0.12s ease;
  box-shadow: 0 3px 0 #8a6417;
}

.copy-btn:hover { transform: translateY(-1px); }

.expires { font-size: 0.7rem; color: rgba(33, 52, 79, 0.6); margin-top: 6px; }

/* ── Button ───────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--circus);
  font-weight: 400;
  font-size: 1.05rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--cream);
  background: linear-gradient(180deg, var(--crimson), var(--crimson-deep));
  border: none;
  border-radius: 10px;
  padding: 15px 30px;
  cursor: pointer;
  transition: transform 0.12s ease;
  box-shadow: 0 5px 0 #4a0d10;
}

.btn:hover:not(:disabled) { transform: translateY(-2px); }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }
.btn:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }

.btn-block { width: 100%; }

.form-error { color: #c43a2c; font-weight: 700; text-align: center; margin-top: 12px; }

.spinner {
  display: inline-block;
  width: 15px;
  height: 15px;
  border: 2.5px solid rgba(246, 234, 210, 0.4);
  border-top-color: var(--cream);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── Barker line ──────────────────────────────────────────────────── */
.barker {
  text-align: center;
  color: var(--ink-soft);
  font-size: 0.92rem;
  max-width: 420px;
  margin: 22px auto 0;
}

/* ── Footer ───────────────────────────────────────────────────────── */
.foot {
  text-align: center;
  padding: 30px 20px;
  color: rgba(246, 234, 210, 0.5);
  font-size: 0.8rem;
}

#wbx-powered-by-slot { margin-top: 12px; }

/* ── Responsive ───────────────────────────────────────────────────── */
@media (max-width: 520px) {
  .ticket { flex-direction: column; }
  .perf {
    flex: 0 0 3px;
    background-image: linear-gradient(90deg, rgba(33, 52, 79, 0.4) 0 8px, transparent 8px 16px);
    background-size: 16px 3px;
    margin: 0 12px;
  }
  .ticket-stub { flex: 0 0 auto; padding: 20px 16px 24px; }
  .ticket.torn .ticket-stub { transform: rotate(1.5deg) translateY(4px); }
}
