/* ===========================================================
   Contest upload page — mobile-first, low-friction upload flow.
   Built on the :root tokens from styles.css (loaded first). Kept
   deliberately simple: no nav, no lang toggle, no hero video, so
   there is nothing here that competes with the one task (upload).
   =========================================================== */

/* The HTML `hidden` attribute's UA-stylesheet `display: none` loses to any
   later same-specificity `.class { display: ... }` rule below (a classic
   gotcha — found by actually screenshotting the page and seeing every
   state, including the success message, rendered at once). This wins
   regardless of what else targets the element. */
[hidden] { display: none !important; }

.page-contest .site-header__inner { justify-content: space-between; }
.contest-back { margin-bottom: 0; }

.contest-hero {
  padding: clamp(3rem, 8vw, 5rem) var(--edge) clamp(1.5rem, 4vw, 2rem);
  text-align: center;
  background: radial-gradient(120% 90% at 50% 0%, var(--plum-800) 0%, var(--plum-950) 62%), var(--plum-950);
}
.contest-hero__inner { max-width: 620px; margin-inline: auto; }
.contest-hero__title { font-size: clamp(1.8rem, 5vw, 2.6rem); }
.contest-hero__sub { margin-top: 0.9rem; margin-inline: auto; }
.contest-hero__window {
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: var(--cream-100);
  opacity: 0.75;
}

/* ---------- Countdown (shared shape with the landing CTA's widget) ---------- */
.contest-countdown {
  margin-top: 1.4rem;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  padding: 0.9rem 1.6rem;
  border-radius: var(--radius);
  border: 1px solid rgba(217, 169, 75, 0.35);
  background: rgba(217, 169, 75, 0.07);
}
.contest-countdown__label {
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  color: var(--cream-100);
  opacity: 0.85;
}
.contest-countdown__value {
  font-family: var(--font-display);
  font-size: 1.3rem;
  letter-spacing: 0.03em;
  color: var(--gold-300);
}
.contest-countdown[data-state="closed"] {
  border-color: rgba(163, 40, 76, 0.5);
  background: rgba(163, 40, 76, 0.1);
}
.contest-countdown[data-state="closed"] .contest-countdown__label {
  color: var(--cream-50);
  opacity: 1;
}
.contest-countdown--hero { margin-inline: auto; }

.contest-form-section {
  padding: 0 var(--edge) clamp(3rem, 8vw, 5rem);
  background: var(--plum-950);
}
.contest-form-wrap {
  max-width: 480px;
  margin-inline: auto;
}

.contest-noscript {
  background: rgba(217, 169, 75, 0.12);
  border: 1px solid rgba(217, 169, 75, 0.4);
  border-radius: var(--radius);
  padding: 1rem 1.2rem;
  margin-bottom: 1.5rem;
  color: var(--gold-100);
  font-size: 0.95rem;
}

.contest-form { display: flex; flex-direction: column; gap: 1.6rem; }
.contest-field { display: flex; flex-direction: column; gap: 0.5rem; }

/* ---------- Honeypot: visually and functionally hidden from real users ---------- */
.contest-honeypot {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- Dropzone / file input ---------- */
.contest-photo-input {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  opacity: 0;
}
.contest-dropzone {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 280px;
  border-radius: var(--radius);
  border: 2px dashed rgba(217, 169, 75, 0.45);
  background: rgba(217, 169, 75, 0.06);
  cursor: pointer;
  overflow: hidden;
  transition: border-color 0.2s, background-color 0.2s;
}
.contest-photo-input:focus-visible + .contest-dropzone,
.contest-dropzone:hover {
  border-color: var(--gold-300);
  background: rgba(217, 169, 75, 0.1);
}
.contest-dropzone.is-disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}
.contest-dropzone__prompt {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.7rem;
  padding: 2rem 1.5rem;
  color: var(--gold-200, var(--gold-300));
  text-align: center;
}
.contest-dropzone__icon { color: var(--gold-300); }
.contest-dropzone__label {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--cream-50);
}
.contest-dropzone__preview {
  display: block;
  width: 100%;
}
.contest-dropzone__preview img {
  width: 100%;
  max-height: 420px;
  object-fit: cover;
  display: block;
}
.contest-replace-btn {
  align-self: center;
  min-height: 44px;
  padding-inline: 0.5rem;
}

/* ---------- Text input ---------- */
.contest-label {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--cream-100);
}
.contest-input {
  min-height: 48px;
  padding: 0.75em 1em;
  border-radius: 12px;
  border: 1.5px solid rgba(217, 169, 75, 0.35);
  background: rgba(255, 255, 255, 0.04);
  color: var(--cream-50);
  font-size: 1rem;
  font-family: var(--font-body);
}
.contest-input::placeholder { color: var(--cream-100); opacity: 0.5; }
.contest-input:focus-visible {
  outline: 2px solid var(--gold-300);
  outline-offset: 2px;
  border-color: var(--gold-300);
}

/* ---------- Checkboxes: large hit area, label is part of the tap target ---------- */
.contest-field--checkbox {
  flex-direction: row;
  align-items: flex-start;
  gap: 0.9rem;
}
.contest-checkbox {
  flex: none;
  width: 26px;
  height: 26px;
  min-width: 44px;
  min-height: 44px;
  margin: 0;
  display: grid;
  place-items: center;
  appearance: none;
  -webkit-appearance: none;
  border-radius: 6px;
  border: 1.5px solid rgba(217, 169, 75, 0.5);
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
  position: relative;
}
.contest-checkbox::before {
  content: "";
  width: 24px;
  height: 24px;
  border-radius: 5px;
  border: 1.5px solid rgba(217, 169, 75, 0.5);
  background: rgba(255, 255, 255, 0.04);
  transition: background-color 0.15s, border-color 0.15s;
}
.contest-checkbox:checked::before {
  background: var(--gold-300);
  border-color: var(--gold-300);
}
.contest-checkbox:checked {
  background-image: none;
}
.contest-checkbox:checked::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 46%;
  width: 12px;
  height: 7px;
  border-left: 2.5px solid var(--ink);
  border-bottom: 2.5px solid var(--ink);
  transform: translate(-50%, -50%) rotate(-45deg);
}
.contest-checkbox:focus-visible {
  outline: 2px solid var(--gold-300);
  outline-offset: 2px;
}
.contest-checkbox-label {
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--cream-100);
  padding-top: 0.55rem;
  cursor: pointer;
}
.contest-checkbox-label a {
  color: var(--gold-300);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.contest-legal-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1rem;
  font-size: 0.85rem;
}
.contest-legal-links a {
  color: var(--gold-100);
  text-decoration: underline;
  text-underline-offset: 2px;
  opacity: 0.85;
  padding-block: 0.3rem;
}
.contest-legal-links a:hover { opacity: 1; }

/* ---------- Progress ---------- */
.contest-progress { display: flex; flex-direction: column; gap: 0.5rem; }
.contest-progress__track {
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}
.contest-progress__bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--gold-400), var(--gold-300));
  transition: width 0.2s linear;
}
.contest-progress__label { font-size: 0.85rem; color: var(--cream-100); }

/* ---------- Status (errors) — never relies on color alone ---------- */
.contest-status {
  font-size: 0.92rem;
  line-height: 1.5;
}
.contest-status:empty { display: none; }
.contest-status[data-tone="error"] {
  color: var(--cream-50);
  background: rgba(163, 40, 76, 0.35);
  border: 1px solid var(--maroon);
  border-radius: 12px;
  padding: 0.8em 1em;
  display: flex;
  align-items: flex-start;
  gap: 0.6em;
}
.contest-status[data-tone="info"] {
  color: var(--gold-100);
  background: rgba(217, 169, 75, 0.12);
  border: 1px solid rgba(217, 169, 75, 0.4);
  border-radius: 12px;
  padding: 0.8em 1em;
  display: flex;
  align-items: flex-start;
  gap: 0.6em;
}

/* ---------- Submit ---------- */
.contest-submit {
  min-height: 52px;
  width: 100%;
  font-size: 1.05rem;
}
.contest-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
}

/* ---------- Success state ---------- */
.contest-success {
  max-width: 480px;
  margin-inline: auto;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 2rem 1rem;
}
.contest-success__icon { color: var(--gold-300); }
.contest-success__text {
  font-size: 1.1rem;
  color: var(--cream-50);
  line-height: 1.6;
}

.contest-footer {
  padding-block: 2rem;
  text-align: center;
}
.contest-footer__text {
  font-size: 0.85rem;
  color: var(--cream-100);
  opacity: 0.7;
}

@media (min-width: 640px) {
  .contest-form-wrap { max-width: 520px; }
}
