/* =============================================================================
 * styles.css — Edvoy Spin-the-Wheel
 * Mobile-first. Brand tokens live in :root (edit here or override from config).
 * =========================================================================== */

:root {
  /* ---- Brand palette (from brand guidelines) ---- */
  --brand-red: #FF3D53;
  --brand-purple: #9317CE;
  --brand-yellow: #FFD560;
  --brand-green: #85E09C;
  --bg: #FFFFFF;

  --brand-gradient: linear-gradient(120deg, #FF3D53 0%, #9317CE 100%);
  --ink: #1B1030;          /* near-black with a purple tint */
  --ink-soft: #5a5170;
  --line: #ece7f3;

  /* ---- Type ---- */
  --font-head: 'Gilroy', 'Poppins', 'Inter', system-ui, sans-serif; /* Gilroy = licensed, Poppins stand-in */
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;

  /* ---- Shape ---- */
  --radius: 18px;
  --radius-lg: 28px;
  --shadow: 0 18px 50px -18px rgba(147, 23, 206, 0.45);
  --shadow-sm: 0 6px 18px -8px rgba(27, 16, 48, 0.35);
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
  overflow-x: hidden;
}

h1, h2, h3 { font-family: var(--font-head); font-weight: 800; margin: 0; line-height: 1.05; }

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ------------------------------- Buttons -------------------------------- */
.btn {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.05rem;
  border: 0;
  border-radius: 999px;
  padding: 15px 28px;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .2s ease, opacity .2s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.btn:active { transform: translateY(1px) scale(0.99); }
.btn--primary {
  background: var(--brand-gradient);
  color: #fff;
  box-shadow: var(--shadow);
}
.btn--primary:hover { box-shadow: 0 22px 60px -18px rgba(147, 23, 206, 0.6); }
.btn--block { width: 100%; }
.btn:disabled { opacity: .6; cursor: not-allowed; }
.btn:focus-visible { outline: 3px solid var(--brand-purple); outline-offset: 3px; }

/* --------------------------------- Hero --------------------------------- */
.hero {
  background:
    radial-gradient(120% 90% at 50% -10%, rgba(147,23,206,.10) 0%, rgba(255,61,83,.06) 40%, transparent 70%),
    var(--bg);
  padding-bottom: 40px;
  min-height: 100svh;
}
.hero__bar {
  padding: 18px 20px;
  display: flex;
  justify-content: center;
}
.hero__logo { height: 44px; width: auto; }

.hero__content {
  max-width: 620px;
  margin: 0 auto;
  padding: 8px 20px 0;
  text-align: center;
}
.hero__headline {
  font-size: clamp(1.9rem, 7vw, 3rem);
  letter-spacing: -0.5px;
  background: var(--brand-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero__subtext {
  font-size: clamp(1rem, 3.6vw, 1.15rem);
  color: var(--ink-soft);
  margin: 14px auto 26px;
  max-width: 440px;
}

/* --------------------------------- Wheel -------------------------------- */
.wheel { display: flex; flex-direction: column; align-items: center; }

.wheel__stage {
  position: relative;
  width: min(88vw, 380px);
  aspect-ratio: 1 / 1;
  margin: 6px auto 8px;
}

.wheel__svg {
  width: 100%;
  height: 100%;
  display: block;
  filter: drop-shadow(0 18px 34px rgba(27,16,48,.28));
  border-radius: 50%;
}

/* the rotating group */
#wheel-rotor {
  transform-box: view-box;      /* origin resolves against the SVG viewBox */
  transform-origin: 200px 200px; /* = wheel centre (viewBox is 0 0 400 400) */
  transform: rotate(0deg);
}
.wheel--spinning #wheel-rotor { will-change: transform; }

/* Pointer at top, pointing down into the wheel */
.wheel__pointer {
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 0; height: 0;
  border-left: 17px solid transparent;
  border-right: 17px solid transparent;
  border-top: 30px solid var(--ink);
  z-index: 4;
  filter: drop-shadow(0 3px 3px rgba(0,0,0,.25));
}
.wheel__pointer::after {
  content: '';
  position: absolute;
  top: -37px; left: -8px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--ink);
}

/* Center hub = spin button */
.wheel__hub {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 27%; height: 27%;
  border-radius: 50%;
  border: 5px solid #fff;
  background: var(--brand-gradient);
  color: #fff;
  font-family: var(--font-head);
  font-weight: 800;
  font-size: clamp(.62rem, 2.6vw, .82rem);
  letter-spacing: .5px;
  cursor: pointer;
  z-index: 3;
  box-shadow: 0 8px 20px -6px rgba(147,23,206,.7);
  transition: transform .12s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1.05;
}
.wheel__hub:hover { transform: translate(-50%, -50%) scale(1.06); }
.wheel__hub:active { transform: translate(-50%, -50%) scale(.96); }
.wheel__hub:disabled { cursor: not-allowed; filter: grayscale(.4) brightness(.9); }
.wheel__hub:focus-visible { outline: 3px solid var(--brand-purple); outline-offset: 4px; }

.wheel__cta { margin-top: 6px; }
.wheel__claimed {
  margin-top: 14px;
  font-family: var(--font-head);
  font-weight: 700;
  color: var(--brand-purple);
  background: rgba(147,23,206,.08);
  padding: 12px 18px;
  border-radius: var(--radius);
}

/* segment label text */
.seg-label {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 13.5px;
}

/* Sound toggle */
.sound-toggle {
  margin-top: 12px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  padding: 7px 14px;
  font-family: var(--font-body);
  font-size: .85rem;
  color: var(--ink-soft);
  cursor: pointer;
}
.sound-toggle[aria-pressed="true"] {
  border-color: var(--brand-purple);
  color: var(--brand-purple);
}
.sound-toggle:focus-visible { outline: 3px solid var(--brand-purple); outline-offset: 2px; }

/* Trust signals */
.trust {
  list-style: none;
  display: flex;
  justify-content: center;
  gap: 10px;
  padding: 0;
  margin: 34px auto 0;
  flex-wrap: wrap;
}
.trust__item {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 18px;
  min-width: 92px;
  box-shadow: var(--shadow-sm);
}
.trust__item strong {
  display: block;
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 1.35rem;
  color: var(--brand-purple);
}
.trust__item span { font-size: .78rem; color: var(--ink-soft); }

/* -------------------------------- Modals -------------------------------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
}
.modal[hidden] { display: none; }
.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(27, 16, 48, 0.55);
  backdrop-filter: blur(3px);
  animation: fade .2s ease;
}
.modal__card {
  position: relative;
  z-index: 2;
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 30px 26px;
  width: 100%;
  max-width: 440px;
  box-shadow: var(--shadow);
  animation: pop .28s cubic-bezier(.2,.9,.3,1.2);
  max-height: 92svh;
  overflow-y: auto;
}
.modal__close {
  position: absolute;
  top: 12px; right: 14px;
  width: 34px; height: 34px;
  border: 0; border-radius: 50%;
  background: #f3eefb;
  color: var(--ink);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}
.modal__close:focus-visible { outline: 3px solid var(--brand-purple); outline-offset: 2px; }

@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { from { opacity: 0; transform: translateY(14px) scale(.96); } to { opacity: 1; transform: none; } }

/* Reveal card */
.confetti { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.reveal-card { text-align: center; }
.reveal-card__eyebrow {
  font-family: var(--font-head);
  font-weight: 700;
  color: var(--brand-red);
  letter-spacing: 1px;
  text-transform: uppercase;
  font-size: .85rem;
  margin: 0 0 6px;
}
.reveal-card__title {
  font-size: clamp(1.5rem, 6vw, 2rem);
  background: var(--brand-gradient);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  margin-bottom: 10px;
}
.reveal-card__benefit { color: var(--ink-soft); margin: 0 0 22px; }
.reveal-card__dismiss {
  display: block;
  margin: 14px auto 0;
  background: none;
  border: 0;
  color: var(--ink-soft);
  text-decoration: underline;
  cursor: pointer;
  font-size: .92rem;
}

/* Claim card */
.claim-card__won {
  font-size: .9rem;
  color: var(--ink-soft);
  margin: 0 0 4px;
}
.claim-card__won strong { color: var(--brand-purple); }
.claim-card__title {
  font-size: clamp(1.3rem, 5vw, 1.6rem);
  margin-bottom: 18px;
}
.claim-card__note {
  font-size: .74rem;
  color: var(--ink-soft);
  margin: 14px 0 0;
  text-align: center;
}

/* Fields */
.field { margin-bottom: 15px; text-align: left; }
.field > label {
  display: block;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: .88rem;
  margin-bottom: 6px;
}
.req { color: var(--brand-red); }
.field input[type="text"],
.field input[type="email"],
.field input[type="tel"],
.field select {
  width: 100%;
  font-family: var(--font-body);
  font-size: 1rem;
  padding: 12px 14px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
}
.field input:focus,
.field select:focus {
  outline: 0;
  border-color: var(--brand-purple);
  box-shadow: 0 0 0 3px rgba(147,23,206,.15);
}
.field__row { display: flex; gap: 8px; }
.field__row select { flex: 0 0 128px; }
.field__row input { flex: 1 1 auto; min-width: 0; }
.field input[aria-invalid="true"],
.field select[aria-invalid="true"] {
  border-color: var(--brand-red);
  box-shadow: 0 0 0 3px rgba(255,61,83,.14);
}
.field__error {
  color: var(--brand-red);
  font-size: .8rem;
  margin: 6px 0 0;
  min-height: 1em;
}
.field__error--form { text-align: center; margin-top: 12px; font-weight: 600; }
.check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: .86rem;
  color: var(--ink-soft);
  margin-bottom: 8px;
  cursor: pointer;
  font-family: var(--font-body);
  font-weight: 400;
}
.check input { width: 18px; height: 18px; accent-color: var(--brand-purple); }
.field input.is-mirrored { background: #f6f2fc; color: var(--ink-soft); }

/* Submit button loading state */
.submit-btn__spinner {
  width: 18px; height: 18px;
  border: 2.5px solid rgba(255,255,255,.4);
  border-top-color: #fff;
  border-radius: 50%;
  display: none;
  animation: spin 0.7s linear infinite;
}
.btn.is-loading .submit-btn__spinner { display: inline-block; }
.btn.is-loading .submit-btn__label { opacity: .8; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Thanks card */
.thanks-card { text-align: center; }
.thanks-card__badge { font-size: 3rem; }
.thanks-card__title { font-size: clamp(1.5rem, 6vw, 2rem); margin: 6px 0 12px; }
.thanks-card__body { color: var(--ink); margin: 0 0 8px; }
.thanks-card__body strong { color: var(--brand-purple); }
.thanks-card__next { color: var(--ink-soft); font-size: .92rem; margin: 0 0 22px; }

/* Footer */
.footer {
  text-align: center;
  padding: 30px 20px 40px;
  color: var(--ink-soft);
  border-top: 1px solid var(--line);
}
.footer img { display: block; margin: 0 auto 10px; opacity: .9; }
.footer p { font-size: .82rem; margin: 0; }

/* --------------------------- Larger screens ----------------------------- */
@media (min-width: 720px) {
  .wheel__stage { width: 420px; }
  .hero__content { padding-top: 20px; }
}

/* --------------------------- Reduced motion ----------------------------- */
@media (prefers-reduced-motion: reduce) {
  #wheel-rotor { transition: none !important; }
  .modal__card, .modal__backdrop { animation: none; }
  .submit-btn__spinner { animation-duration: 1.2s; }
}
