/* ── Receipt Upload Sweepstakes — giant thermal receipt ─────────────
   Long white receipt on a slate counter, zigzag perforated edges,
   monospace type, dashed dividers, barcode footer, ink-blue stamps. */

:root {
  --counter: #3d434d;
  --paper: #fdfdfb;
  --ink: #2b2b2b;
  --ink-soft: #7c7c76;
  --blue: #2456c4;
  --line: #d9d9d2;
  --err: #c0392b;
  --font: 'Space Mono', monospace;
}

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

.hidden { display: none !important; }

body {
  font-family: var(--font);
  background:
    radial-gradient(ellipse at 50% 0%, rgba(255, 255, 255, 0.06), transparent 60%),
    var(--counter);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

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

/* ── Receipt sheet ────────────────────────────────────────────────── */
.receipt {
  width: calc(100% - 32px);
  max-width: 480px;
  margin: 40px auto 0;
  filter: drop-shadow(0 24px 40px rgba(0, 0, 0, 0.4));
  flex: 1 0 auto;
}

.receipt-body { background: var(--paper); padding: 30px 28px 24px; }

/* Zigzag perforations */
.perf {
  height: 16px;
  background: var(--paper);
}

.perf-top {
  -webkit-clip-path: polygon(0 100%, 100% 100%, 100% 40%, 97.5% 100%, 95% 40%, 92.5% 100%, 90% 40%, 87.5% 100%, 85% 40%, 82.5% 100%, 80% 40%, 77.5% 100%, 75% 40%, 72.5% 100%, 70% 40%, 67.5% 100%, 65% 40%, 62.5% 100%, 60% 40%, 57.5% 100%, 55% 40%, 52.5% 100%, 50% 40%, 47.5% 100%, 45% 40%, 42.5% 100%, 40% 40%, 37.5% 100%, 35% 40%, 32.5% 100%, 30% 40%, 27.5% 100%, 25% 40%, 22.5% 100%, 20% 40%, 17.5% 100%, 15% 40%, 12.5% 100%, 10% 40%, 7.5% 100%, 5% 40%, 2.5% 100%, 0 40%);
  clip-path: polygon(0 100%, 100% 100%, 100% 40%, 97.5% 100%, 95% 40%, 92.5% 100%, 90% 40%, 87.5% 100%, 85% 40%, 82.5% 100%, 80% 40%, 77.5% 100%, 75% 40%, 72.5% 100%, 70% 40%, 67.5% 100%, 65% 40%, 62.5% 100%, 60% 40%, 57.5% 100%, 55% 40%, 52.5% 100%, 50% 40%, 47.5% 100%, 45% 40%, 42.5% 100%, 40% 40%, 37.5% 100%, 35% 40%, 32.5% 100%, 30% 40%, 27.5% 100%, 25% 40%, 22.5% 100%, 20% 40%, 17.5% 100%, 15% 40%, 12.5% 100%, 10% 40%, 7.5% 100%, 5% 40%, 2.5% 100%, 0 40%);
}

.perf-bottom { transform: scaleY(-1); }

.perf-bottom {
  -webkit-clip-path: polygon(0 100%, 100% 100%, 100% 40%, 97.5% 100%, 95% 40%, 92.5% 100%, 90% 40%, 87.5% 100%, 85% 40%, 82.5% 100%, 80% 40%, 77.5% 100%, 75% 40%, 72.5% 100%, 70% 40%, 67.5% 100%, 65% 40%, 62.5% 100%, 60% 40%, 57.5% 100%, 55% 40%, 52.5% 100%, 50% 40%, 47.5% 100%, 45% 40%, 42.5% 100%, 40% 40%, 37.5% 100%, 35% 40%, 32.5% 100%, 30% 40%, 27.5% 100%, 25% 40%, 22.5% 100%, 20% 40%, 17.5% 100%, 15% 40%, 12.5% 100%, 10% 40%, 7.5% 100%, 5% 40%, 2.5% 100%, 0 40%);
  clip-path: polygon(0 100%, 100% 100%, 100% 40%, 97.5% 100%, 95% 40%, 92.5% 100%, 90% 40%, 87.5% 100%, 85% 40%, 82.5% 100%, 80% 40%, 77.5% 100%, 75% 40%, 72.5% 100%, 70% 40%, 67.5% 100%, 65% 40%, 62.5% 100%, 60% 40%, 57.5% 100%, 55% 40%, 52.5% 100%, 50% 40%, 47.5% 100%, 45% 40%, 42.5% 100%, 40% 40%, 37.5% 100%, 35% 40%, 32.5% 100%, 30% 40%, 27.5% 100%, 25% 40%, 22.5% 100%, 20% 40%, 17.5% 100%, 15% 40%, 12.5% 100%, 10% 40%, 7.5% 100%, 5% 40%, 2.5% 100%, 0 40%);
}

/* ── Header ───────────────────────────────────────────────────────── */
.r-head { text-align: center; }

.store-line { font-size: 0.82rem; letter-spacing: 0.2em; color: var(--ink-soft); }

.r-head h1 {
  font-size: clamp(1.3rem, 5.5vw, 1.7rem);
  font-weight: 700;
  text-transform: uppercase;
  line-height: 1.35;
  margin: 12px 0;
}

.r-divider { color: var(--ink-soft); overflow: hidden; white-space: nowrap; margin: 10px 0; }

.req-line { font-size: 0.85rem; color: var(--ink-soft); }

/* ── Notes ────────────────────────────────────────────────────────── */
.note {
  margin: 20px 0;
  padding: 14px;
  border: 2px dashed var(--ink);
  text-align: center;
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0.06em;
}

/* ── Form ─────────────────────────────────────────────────────────── */
.step-line {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: var(--blue);
  margin: 24px 0 10px;
  border-bottom: 1px dashed var(--line);
  padding-bottom: 6px;
}

/* Drop zone */
.drop { position: relative; border: 2px dashed var(--line); background: #f7f7f2; transition: border-color 0.15s ease; }

.drop:hover, .drop.dragover { border-color: var(--blue); }

.drop input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 2;
}

.drop-inner { padding: 34px 16px; text-align: center; }

.drop-icon { font-size: 2.2rem; display: block; margin-bottom: 8px; }

.drop-text { font-weight: 700; font-size: 0.88rem; letter-spacing: 0.08em; }

.drop-hint { font-size: 0.76rem; color: var(--ink-soft); margin-top: 4px; }

.preview { display: block; width: 100%; max-height: 320px; object-fit: contain; background: #fff; }

/* Fields */
.field { margin-bottom: 14px; }

label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  margin-bottom: 5px;
  color: var(--ink-soft);
}

input[type="text"],
input[type="email"] {
  width: 100%;
  padding: 12px 13px;
  font-size: 0.95rem;
  font-family: inherit;
  color: var(--ink);
  background: #f7f7f2;
  border: 2px solid var(--line);
  transition: border-color 0.15s ease;
}

input:focus { outline: none; border-color: var(--blue); }
input.error { border-color: var(--err); }
input::placeholder { color: var(--ink-soft); opacity: 0.65; }

.fine { margin-top: 12px; text-align: center; color: var(--ink-soft); font-size: 0.76rem; }

.rules-link {
  background: none;
  border: none;
  color: var(--blue);
  font-family: inherit;
  font-size: inherit;
  font-weight: 700;
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
}

.form-error { color: var(--err); font-weight: 700; text-align: center; margin-top: 10px; font-size: 0.86rem; }

/* ── Buttons ──────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 15px 26px;
  border: 2px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  cursor: pointer;
  transition: transform 0.12s ease, background 0.12s ease;
  line-height: 1.2;
  margin-top: 18px;
}

.btn:hover:not(:disabled) { background: var(--blue); border-color: var(--blue); transform: translateY(-1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }

.btn-block { width: 100%; }

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

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

/* ── Done ─────────────────────────────────────────────────────────── */
.done-block { text-align: center; padding: 20px 0 6px; }

.stamp {
  display: inline-block;
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: 0.24em;
  color: var(--blue);
  border: 3px double var(--blue);
  padding: 8px 24px;
  transform: rotate(-5deg);
  margin-bottom: 16px;
}

.done-block h2 { font-size: 1.35rem; letter-spacing: 0.12em; }

.done-sub { color: var(--ink-soft); font-size: 0.88rem; margin-top: 10px; }

.thanks-line { font-size: 0.8rem; letter-spacing: 0.14em; color: var(--ink-soft); }

/* ── Barcode ──────────────────────────────────────────────────────── */
.barcode {
  height: 54px;
  margin: 28px auto 6px;
  max-width: 260px;
  background: repeating-linear-gradient(
    90deg,
    var(--ink) 0 2px, transparent 2px 5px,
    var(--ink) 5px 9px, transparent 9px 11px,
    var(--ink) 11px 12px, transparent 12px 16px,
    var(--ink) 16px 19px, transparent 19px 21px
  );
}

.barcode-num { text-align: center; font-size: 0.72rem; letter-spacing: 0.3em; color: var(--ink-soft); }

/* ── Rules modal ──────────────────────────────────────────────────── */
.modal {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(0, 0, 0, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal-card {
  background: var(--paper);
  color: var(--ink);
  max-width: 620px;
  width: 100%;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.5);
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 2px dashed var(--line);
}

.modal-head h3 { font-size: 1rem; letter-spacing: 0.1em; text-transform: uppercase; }

.modal-close {
  background: none;
  border: none;
  font-size: 1.8rem;
  line-height: 1;
  color: var(--ink-soft);
  cursor: pointer;
  font-family: inherit;
}

.modal-body {
  padding: 18px 20px;
  overflow-y: auto;
  font-size: 0.84rem;
  white-space: pre-wrap;
}

/* ── Toast ────────────────────────────────────────────────────────── */
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  background: var(--ink);
  color: #fff;
  padding: 13px 24px;
  font-weight: 700;
  font-size: 0.88rem;
  z-index: 400;
  max-width: 92vw;
  text-align: center;
}

/* ── Footer ───────────────────────────────────────────────────────── */
.footer {
  flex-shrink: 0;
  text-align: center;
  padding: 26px 20px;
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.78rem;
}

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

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
