/* ==========================================================================
   Clorox Spin & Win
   ========================================================================== */

:root {
  --navy: #0e2151;
  --navy-deep: #081431;
  --navy-light: #1c3576;
  --accent: #2f6fed;
  --accent-deep: #1145a8;
  --accent-bright: #7ab3ff;
  --gold: #f3c157;
  --gold-deep: #d98f1e;
  --red: #e4032e;
  --cream: #f8f6ef;
  --ink: #14162b;
  --ink-soft: #5b5f7a;
  --white: #ffffff;
  --surface: #ffffff;
  --success: #1f9d63;

  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 10px;
  --shadow-soft: 0 18px 40px -18px rgba(14, 33, 81, 0.35);
  --shadow-card: 0 10px 30px -12px rgba(14, 33, 81, 0.25);

  --font-display: 'Outfit', system-ui, sans-serif;
  --font-body: 'Manrope', system-ui, sans-serif;
}

/* This campaign's white/blue/gold brand look is fixed intentionally — it
   does not follow the visitor's OS/browser dark-mode setting. */

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--cream);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3, h4 { font-family: var(--font-display); color: var(--navy); margin: 0; }
p { margin: 0; color: var(--ink-soft); line-height: 1.6; }

.wrap {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 20px;
}

.text-accent { color: var(--accent-bright); }

/* ---------------------------------------------------------------------- */
/* Buttons                                                                 */
/* ---------------------------------------------------------------------- */
.btn {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  border: none;
  border-radius: 999px;
  padding: 14px 26px;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, opacity .18s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: .45; cursor: not-allowed; }

.btn-primary {
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-deep) 100%);
  color: var(--navy);
  box-shadow: 0 10px 24px -8px rgba(217, 143, 30, 0.55);
}
.btn-primary:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 14px 28px -8px rgba(217, 143, 30, 0.65); }

.btn-ghost {
  background: transparent;
  color: var(--navy);
  border: 2px solid rgba(14, 33, 81, 0.15);
}
.btn-ghost:hover { border-color: var(--navy); }

.btn-lg { padding: 17px 34px; font-size: 16px; }
.arrow { transition: transform .18s ease; display: inline-block; }
.btn:hover .arrow { transform: translateX(3px); }

.btn-spinner {
  width: 16px; height: 16px;
  border: 2px solid rgba(14,33,81,.25);
  border-top-color: var(--navy-deep);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------------------------------------------------------------- */
/* Ambient confetti (hero background flourish)                            */
/* ---------------------------------------------------------------------- */
.confetti-ambient {
  position: fixed;
  inset: 0;
  pointer-events: none;
  /* Above .hero/section (z-index:1) and .floating-badge (z-index:2) so it
     drifts over the whole page, not just areas without their own stacking
     context — otherwise the hero (and anything else with a z-index) paints
     over it and it only ever shows through on plain, unpositioned sections. */
  z-index: 3;
  overflow: hidden;
}
.confetti-ambient span {
  position: absolute;
  top: -5vh;
  width: 8px;
  height: 14px;
  opacity: 0.75;
  animation: ambient-fall linear infinite;
  border-radius: 2px;
}
@keyframes ambient-fall {
  0%   { transform: translateY(0) rotate(0deg); opacity: 0; }
  8%   { opacity: .75; }
  36%  { opacity: .7; }
  50%  { opacity: 0; }
  100% { transform: translateY(108vh) rotate(360deg); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .confetti-ambient { display: none; }
}

/* ---------------------------------------------------------------------- */
/* Hero brand row (the campaign logo, sits inside the hero above the headline) */
/* ---------------------------------------------------------------------- */
.hero-brand-row {
  display: flex;
  justify-content: center;
  margin-bottom: 22px;
}
.hero-logo { height: clamp(96px, 30vw, 190px); width: auto; max-width: 100%; display: block; }

/* ---------------------------------------------------------------------- */
/* Hero                                                                    */
/* ---------------------------------------------------------------------- */
.hero {
  position: relative;
  z-index: 1;
  overflow: hidden;
  min-height: max(82vh, 560px);
  display: flex;
  align-items: center;
  padding: 40px 0 56px;
  background:
    linear-gradient(180deg, rgba(8,20,49,.32) 0%, rgba(8,20,49,.72) 48%, var(--navy-deep) 82%),
    url('../img/hero-bg-phone.jpg') center 12% / cover no-repeat;
}
.hero-inner { display: flex; justify-content: center; }
.hero-copy {
  position: relative;
  text-align: center;
  max-width: 560px;
}
.hero-copy h1 {
  font-size: clamp(2.1rem, 8vw, 3.2rem);
  line-height: 1.1;
  font-weight: 800;
  margin-bottom: 16px;
  color: var(--white);
}
.clorox-inline-logo {
  height: 1.5em;
  width: auto;
  vertical-align: -0.42em;
  display: inline-block;
}
.hero-sub {
  font-size: 16px;
  max-width: 42ch;
  margin: 0 auto 26px;
  color: rgba(255,255,255,.82);
}
.headline-wrap { position: relative; }
/* Two flex rows (top / bottom) pinned to the hero's top and bottom margins,
   the only bands guaranteed clear of the centered logo/heading/subtitle/
   button column. Flex handles horizontal spacing automatically so badges
   never collide with each other regardless of label width — each badge
   then gets its own small vertical nudge and tilt so the row doesn't read
   as a rigid, perfectly-aligned line. */
.badge-row {
  position: absolute;
  left: 0;
  right: 0;
  z-index: 2;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 0 4%;
  pointer-events: none;
  opacity: 1;
  transition: opacity .35s ease, transform .35s ease;
}
/* Once the entry form is open there's no room for them and they'd just
   clutter the flow card, so fade them out rather than leaving them floating
   behind the form. */
.hero.flow-active .badge-row-top { opacity: 0; transform: translateY(-16px); }
.hero.flow-active .badge-row-bottom { opacity: 0; transform: translateY(16px); }
.badge-row-top { top: 0; }
.badge-row-bottom { bottom: 0; }
.floating-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 88px;
  animation: float 5s ease-in-out infinite;
}
.floating-badge img {
  width: 84px;
  height: 84px;
  object-fit: contain;
  filter: drop-shadow(0 6px 10px rgba(0,0,0,.35));
}
.badge-label {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 11px;
  line-height: 1.2;
  color: #fff;
  text-align: center;
  white-space: nowrap;
  text-shadow: 0 1px 4px rgba(0,0,0,.9), 0 0 10px rgba(0,0,0,.55);
}
.badge-5 img, .badge-6 img { width: 66px; height: 66px; }
.badge-1 { animation-delay: 0s;   margin-top: 0px;  --tilt: -6deg; }
.badge-2 { animation-delay: 1.2s; margin-top: 8px; --tilt: 5deg; }
.badge-4 { animation-delay: 0.6s; margin-top: 0px;  --tilt: -4deg; }
.badge-6 { animation-delay: 3s;   margin-top: 0px;  --tilt: -3deg; }
.badge-5 { animation-delay: 1.8s; margin-top: 0px;  --tilt: 3deg; }
.badge-3 { animation-delay: 2.4s; margin-top: 10px; --tilt: 6deg; }
@keyframes float {
  0%, 100% { transform: translateY(0) rotate(var(--tilt, 0deg)); }
  50% { transform: translateY(-10px) rotate(var(--tilt, 0deg)); }
}
@media (prefers-reduced-motion: reduce) { .floating-badge { animation: none; } }

/* Tablet */
@media (min-width: 640px) {
  .hero { min-height: max(70vh, 620px); padding-bottom: 104px; }
  .badge-row { padding: 0 3%; }
  .floating-badge { width: 108px; gap: 6px; }
  .floating-badge img { width: 100px; height: 100px; }
  .badge-5 img, .badge-6 img { width: 80px; height: 80px; }
  .badge-label { font-size: 12px; }
}
/* Desktop */
@media (min-width: 1024px) {
  .badge-row { padding: 0 2.5%; }
  .floating-badge { width: 128px; }
  .floating-badge img { width: 120px; height: 120px; }
  .badge-5 img, .badge-6 img { width: 96px; height: 96px; }
}

/* ---------------------------------------------------------------------- */
/* Section shared                                                         */
/* ---------------------------------------------------------------------- */
section { position: relative; z-index: 1; }

/* ---------------------------------------------------------------------- */
/* App flow card                                                          */
/* ---------------------------------------------------------------------- */
.app-flow { padding: 36px 0 70px; }
.flow-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  padding: clamp(24px, 4vw, 46px);
  max-width: 720px;
  margin: 0 auto;
}

.flow-progress {
  display: flex; align-items: center; justify-content: center;
  gap: 8px;
  margin-bottom: 34px;
}
.fp-step {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--font-display); font-weight: 700; font-size: 13px;
  color: var(--ink-soft);
}
.fp-step span {
  width: 26px; height: 26px; border-radius: 50%;
  background: rgba(14,33,81,.08);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; color: var(--ink-soft);
  transition: background .25s ease, color .25s ease;
}
.fp-step.active span, .fp-step.done span {
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  color: var(--white);
}
.fp-step.active, .fp-step.done { color: var(--navy); }
.fp-line { width: 30px; height: 2px; background: rgba(14,33,81,.12); }

.flow-panel { display: none; }
.flow-panel.active { display: block; animation: panel-in .35s ease; }
@keyframes panel-in { from { opacity: 0; transform: translateX(12px); } to { opacity: 1; transform: translateX(0); } }

.flow-panel h3 { font-size: 22px; margin-bottom: 6px; text-align: center; }
.panel-sub { text-align: center; font-size: 14px; margin-bottom: 26px; }

.flow-actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 26px; }

/* store grid */
.store-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}
.store-card {
  border: 2px solid rgba(14,33,81,.12);
  background: transparent;
  border-radius: var(--radius-sm);
  padding: 16px 12px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 13.5px;
  color: var(--ink);
  text-align: center;
  cursor: pointer;
  transition: border-color .18s ease, background .18s ease, transform .12s ease;
}
.store-card:hover { border-color: var(--accent-deep); }
.store-card.selected {
  border-color: var(--navy);
  background: linear-gradient(135deg, rgba(47,111,237,.14), rgba(17,69,168,.10));
  color: var(--navy);
  transform: translateY(-2px);
}
.loading-text { grid-column: 1/-1; text-align: center; color: var(--ink-soft); font-size: 14px; }

/* form */
.field { margin-bottom: 18px; }
.field label {
  display: block;
  font-family: var(--font-display); font-weight: 700; font-size: 13px;
  color: var(--navy); margin-bottom: 7px;
}
.field input[type="text"],
.field input[type="email"],
.field input[type="tel"] {
  width: 100%;
  padding: 13px 15px;
  border-radius: var(--radius-sm);
  border: 2px solid rgba(14,33,81,.14);
  background: var(--cream);
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--ink);
  transition: border-color .18s ease;
}
.field input:focus { outline: none; border-color: var(--accent-deep); }
.field-error {
  display: block;
  color: var(--red);
  font-size: 12.5px;
  margin-top: 6px;
  min-height: 1em;
}
.form-error {
  color: var(--red);
  font-size: 13.5px;
  text-align: center;
  margin: 4px 0 0;
  min-height: 1em;
}

.mobile-input {
  display: flex;
  border-radius: var(--radius-sm);
  border: 2px solid rgba(14,33,81,.14);
  background: var(--cream);
  overflow: hidden;
}
.mobile-input:focus-within { border-color: var(--accent-deep); }
.mobile-prefix {
  padding: 13px 12px;
  font-weight: 700;
  color: var(--navy);
  background: rgba(14,33,81,.06);
  font-family: var(--font-display);
}
.mobile-input input {
  border: none !important;
  background: transparent !important;
  flex: 1;
  padding: 13px 15px;
  font-size: 15px;
  color: var(--ink);
}
.mobile-input input:focus { outline: none; }

.upload-drop {
  display: flex; align-items: center; justify-content: center;
  min-height: 110px;
  border: 2px dashed rgba(14,33,81,.25);
  border-radius: var(--radius-sm);
  background: var(--cream);
  cursor: pointer;
  text-align: center;
  padding: 16px;
  font-size: 13.5px;
  color: var(--ink-soft);
  transition: border-color .18s ease, background .18s ease;
}
.upload-drop:hover { border-color: var(--accent-deep); }
.upload-drop.has-file { border-style: solid; border-color: var(--success); }
.upload-drop img { max-height: 140px; max-width: 100%; border-radius: 8px; }

.upload-progress { margin-top: 16px; }
.upload-progress-track {
  width: 100%; height: 8px;
  border-radius: 999px;
  background: rgba(14,33,81,.1);
  overflow: hidden;
}
.upload-progress-fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent-deep));
  border-radius: 999px;
  transition: width .15s ease;
}
.upload-progress-label {
  display: block;
  text-align: center;
  font-size: 12.5px;
  color: var(--ink-soft);
  margin-top: 6px;
}

/* ---------------------------------------------------------------------- */
/* Wheel                                                                   */
/* ---------------------------------------------------------------------- */
.wheel-wrap {
  position: relative;
  width: min(400px, 90vw);
  aspect-ratio: 1;
  margin: 10px auto 8px;
  display: flex; align-items: center; justify-content: center;
}
.wheel-pointer {
  position: absolute;
  top: -6px; left: 50%;
  transform: translateX(-50%);
  font-size: 30px;
  color: var(--red);
  z-index: 5;
  filter: drop-shadow(0 3px 4px rgba(0,0,0,.25));
}
.wheel {
  position: relative;
  display: block;
  width: 100%; height: 100%;
  border-radius: 50%;
  border: 8px solid var(--white);
  box-shadow: 0 0 0 6px var(--navy), var(--shadow-soft);
  overflow: hidden;
}
.seg-label {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 8.5px;
  letter-spacing: -0.1px;
  fill: var(--white);
}
/* Text color follows the segment's background (white bg -> navy text, navy bg -> white text). */
.seg-label.seg-label-dark { fill: var(--navy); }

.wheel-center {
  position: absolute;
  width: 74px; height: 74px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  color: var(--white);
  border: 4px solid var(--white);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 15px;
  cursor: pointer;
  box-shadow: 0 10px 24px -6px rgba(17,69,168,.7);
  z-index: 6;
  transition: transform .15s ease;
}
.wheel-center:hover:not(:disabled) { transform: scale(1.05); }
.wheel-center:disabled { cursor: not-allowed; opacity: .7; animation: none; }

/* Draws the eye to the spin button — a pulsing gold ring, matching the
   brand's primary-CTA gold. Stops as soon as it's disabled (mid-spin/spun). */
.wheel-center:not(:disabled) {
  animation: wheel-center-pulse 1.8s ease-in-out infinite;
}
@keyframes wheel-center-pulse {
  0%, 100% { box-shadow: 0 10px 24px -6px rgba(17,69,168,.7), 0 0 0 0 rgba(243,193,87,.55); }
  50%      { box-shadow: 0 10px 24px -6px rgba(17,69,168,.7), 0 0 0 14px rgba(243,193,87,0); }
}
@media (prefers-reduced-motion: reduce) {
  .wheel-center { animation: none; }
}

/* ---------------------------------------------------------------------- */
/* Result overlay                                                          */
/* ---------------------------------------------------------------------- */
.result-overlay {
  position: fixed; inset: 0;
  background: rgba(8, 20, 49, 0.66);
  backdrop-filter: blur(3px);
  display: none;
  align-items: center; justify-content: center;
  z-index: 100;
  padding: 20px;
}
.result-overlay.show { display: flex; }
.result-card {
  position: relative;
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 40px 30px 32px;
  max-width: 380px;
  width: 100%;
  text-align: center;
  box-shadow: 0 30px 70px -20px rgba(0,0,0,.5);
  animation: result-pop .4s cubic-bezier(.2,1.3,.4,1);
}
@keyframes result-pop { from { opacity: 0; transform: scale(.85) translateY(10px); } to { opacity: 1; transform: scale(1) translateY(0); } }
.result-close {
  position: absolute; top: 14px; right: 14px;
  width: 30px; height: 30px; border-radius: 50%;
  border: none; background: rgba(14,33,81,.08);
  cursor: pointer; font-size: 14px; color: var(--ink-soft);
}
.result-icon { font-size: 52px; margin-bottom: 6px; }
.result-icon.shake { animation: shake .5s ease; }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px) rotate(-4deg); }
  40% { transform: translateX(8px) rotate(4deg); }
  60% { transform: translateX(-6px) rotate(-3deg); }
  80% { transform: translateX(6px) rotate(3deg); }
}
.result-card h2 { font-size: 22px; margin-bottom: 10px; }
.result-card p { font-size: 14.5px; }
.result-prize[hidden] { display: none; }
.result-prize {
  margin: 18px 0;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  background: linear-gradient(135deg, rgba(47,111,237,.16), rgba(17,69,168,.10));
  border-radius: var(--radius-sm);
  padding: 14px;
}
.result-prize-icon { font-size: 28px; }
.result-prize-name { font-family: var(--font-display); font-weight: 800; color: var(--navy); font-size: 16px; }
.result-card .btn { margin-top: 20px; width: 100%; }

.confetti-canvas {
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 110;
}

/* ---------------------------------------------------------------------- */
/* Footer                                                                  */
/* ---------------------------------------------------------------------- */
.site-footer {
  background: var(--navy-deep);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 34px 0;
}
.footer-inner { text-align: center; }
.footer-inner p { font-size: 12px; color: rgba(255,255,255,.55); max-width: 640px; margin: 0 auto; line-height: 1.7; }
.footer-link { color: rgba(255,255,255,.85); text-decoration: underline; text-underline-offset: 2px; }
.footer-link:hover, .footer-link:focus-visible { color: var(--white); }

/* ---------------------------------------------------------------------- */
/* Terms & Conditions dialog                                               */
/* ---------------------------------------------------------------------- */
.terms-dialog {
  border: none; padding: 0;
  width: min(680px, calc(100vw - 32px));
  max-height: 86vh; max-height: 86dvh;
  background: var(--surface); color: var(--ink);
  border-radius: var(--radius-lg);
  box-shadow: 0 30px 70px -20px rgba(0,0,0,.5);
  overflow: hidden;
}
.terms-dialog[open] { display: flex; flex-direction: column; }
.terms-dialog::backdrop { background: rgba(8, 20, 49, 0.66); backdrop-filter: blur(3px); }
html:has(.terms-dialog[open]) { overflow: hidden; }
.terms-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 18px 22px;
  border-bottom: 1px solid rgba(14, 33, 81, 0.1);
}
.terms-head h2 { font-size: 20px; }
.terms-close { position: static; flex: none; }
.terms-body {
  overflow-y: auto; overscroll-behavior: contain;
  padding: 18px 22px 26px;
  font-size: 14px; line-height: 1.65;
  overflow-wrap: anywhere;
}
.terms-body p { color: var(--ink); margin: 0 0 12px; }
.terms-body h3 { font-size: 16px; margin: 22px 0 10px; }
.terms-body ol { margin: 0 0 12px; padding-left: 22px; }
.terms-body li { margin-bottom: 8px; }
.terms-body li > ol { margin-top: 8px; }

@media (max-width: 520px) {
  .flow-progress { gap: 4px; }
  .fp-step span { width: 22px; height: 22px; }
  .fp-line { width: 18px; }
  .fp-step { font-size: 11px; }
}
