/* Colours and fonts are placeholders. form.js swaps in the brand settings. */
:root {
  --bg: #FFF8EC;
  --surface: #FFFFFF;
  --ink: #111111;
  --accent: #FFD60A;
  --spark: #FF5FA2;
  --spark-alt: #3DD6F5;
  --font-heading: "Archivo Black", system-ui, sans-serif;
  --font-serif: "DM Serif Display", Georgia, serif;
  --font-body: "Source Sans 3", system-ui, sans-serif;
  --radius: 22px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.shell {
  max-width: 560px;
  margin: 0 auto;
  min-height: 100dvh;
  padding: 16px 16px calc(24px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
}

/* Top bar */
.top {
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
}
.brand {
  grid-column: 2;
  text-align: center;
  font-family: var(--font-heading);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 14px;
}
.brand img { max-height: 32px; vertical-align: middle; }
.back {
  grid-column: 1;
  grid-row: 1;
  width: 44px;
  height: 44px;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: var(--surface);
  color: var(--ink);
  font-size: 20px;
  cursor: pointer;
}
.progress {
  grid-column: 1 / -1;
  height: 8px;
  border-radius: 99px;
  background: color-mix(in srgb, var(--ink) 10%, transparent);
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  width: 0;
  background: var(--ink);
  border-radius: 99px;
  transition: width 0.35s ease;
}

/* Steps */
main { flex: 1; display: flex; }
.step {
  display: none;
  flex-direction: column;
  width: 100%;
  animation: slide-in 0.3s ease;
}
.step.is-active { display: flex; }
@keyframes slide-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}

h1, h2 {
  font-family: var(--font-heading);
  text-transform: uppercase;
  line-height: 1.05;
  margin: 0 0 12px;
  letter-spacing: -0.01em;
}
h1 { font-size: clamp(30px, 9vw, 44px); }
h2 { font-size: clamp(24px, 7vw, 34px); }
.serif {
  font-family: var(--font-serif);
  text-transform: none;
  font-weight: 400;
}
.highlight {
  background: linear-gradient(transparent 60%, var(--accent) 60%);
  padding: 0 0.1em;
}
.helper, .muted {
  color: color-mix(in srgb, var(--ink) 65%, transparent);
  margin: 0 0 18px;
}
.card {
  background: var(--surface);
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: 5px 5px 0 var(--ink);
}

/* Fields */
label.field { display: block; margin-bottom: 16px; font-weight: 600; }
label.field span.optional { font-weight: 400; color: color-mix(in srgb, var(--ink) 55%, transparent); }
label.field small { display: block; font-weight: 400; color: color-mix(in srgb, var(--ink) 60%, transparent); }
input[type="text"], input[type="email"], textarea {
  width: 100%;
  margin-top: 6px;
  font: inherit;
  font-size: 18px; /* 16px or more stops iPhones zooming in */
  color: var(--ink);
  background: var(--surface);
  border: 2px solid var(--ink);
  border-radius: 14px;
  padding: 14px 16px;
}
textarea { min-height: 180px; resize: vertical; }
input:focus, textarea:focus, button:focus-visible, .star:focus-visible {
  outline: 3px solid var(--spark-alt);
  outline-offset: 2px;
}

/* Honeypot: hidden from people, visible to bots */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Buttons */
/* Buttons sit right under the content instead of at the bottom of the screen. */
.actions { padding-top: 24px; display: grid; gap: 10px; }

/* Welcome words */
.intro { color: color-mix(in srgb, var(--ink) 72%, transparent); }
.intro p { margin: 0 0 14px; white-space: pre-line; }
.intro ul { margin: 0 0 14px; padding-left: 1.2em; }
.intro li { margin: 0 0 6px; }
.intro > :last-child { margin-bottom: 0; }
.btn {
  appearance: none;
  border: 2px solid var(--ink);
  border-radius: 99px;
  padding: 16px 24px;
  font-family: var(--font-heading);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 16px;
  cursor: pointer;
  background: var(--accent);
  color: var(--ink);
  box-shadow: 3px 3px 0 var(--ink);
  transition: transform 0.1s ease, box-shadow 0.1s ease;
  text-align: center;
  text-decoration: none;
}
.btn:active { transform: translate(3px, 3px); box-shadow: 0 0 0 var(--ink); }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; }
.btn.ghost { background: transparent; box-shadow: none; }
.error {
  color: #B00020;
  font-weight: 600;
  margin: 12px 0 0;
  min-height: 1.5em;
}
.error:empty { min-height: 0; margin: 0; }

/* Stars */
.stars { display: flex; justify-content: center; gap: 6px; margin: 24px 0 8px; }
.star {
  appearance: none;
  background: none;
  border: 0;
  padding: 4px;
  cursor: pointer;
  font-size: 0;
  border-radius: 12px;
}
.star svg { width: 52px; height: 52px; display: block; transition: transform 0.15s ease; }
.star path { fill: transparent; stroke: var(--ink); stroke-width: 1.5; stroke-linejoin: round; }
.star.is-on path { fill: var(--accent); }
.star.is-on svg { transform: scale(1.08); }
.rating-label { text-align: center; font-family: var(--font-serif); font-size: 22px; min-height: 1.5em; }

/* Photo */
.photo-drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
  padding: 28px 20px;
  border: 2px dashed var(--ink);
  border-radius: var(--radius);
  background: var(--surface);
  cursor: pointer;
}
.photo-drop input { display: none; }
.photo-preview {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  border: 3px solid var(--ink);
  object-fit: cover;
  display: block;
  margin: 0 auto 12px;
}
.cropper {
  position: relative;
  width: min(100%, 320px);
  aspect-ratio: 1;
  margin: 0 auto;
  overflow: hidden;
  border-radius: var(--radius);
  background: #222;
  touch-action: none;
  cursor: grab;
}
.cropper canvas { width: 100%; height: 100%; display: block; }
.cropper::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  box-shadow: 0 0 0 999px rgba(0, 0, 0, 0.45);
  pointer-events: none;
}
.zoom { display: flex; align-items: center; gap: 12px; margin: 16px auto 0; width: min(100%, 320px); }
.zoom input { flex: 1; accent-color: var(--ink); }

/* Consent */
.check {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 0;
  border-bottom: 1px solid color-mix(in srgb, var(--ink) 15%, transparent);
  cursor: pointer;
}
.check input { width: 24px; height: 24px; margin: 2px 0 0; accent-color: var(--ink); flex: none; }

/* Consent questions */
.consent-q { padding: 4px 0 16px; }
.consent-q + .consent-q { border-top: 1px solid color-mix(in srgb, var(--ink) 15%, transparent); padding-top: 16px; }
.consent-text { font-weight: 700; margin: 0 0 10px; }
.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.choice {
  appearance: none;
  font: inherit;
  font-weight: 700;
  padding: 12px;
  border: 2px solid var(--ink);
  border-radius: 99px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
}
.choice[aria-pressed="true"] { background: var(--ink); color: var(--surface); }
.choice:focus-visible { outline: 3px solid var(--spark-alt); outline-offset: 2px; }

/* Thank you */
.thanks { text-align: center; }
.thanks .big { font-size: 64px; line-height: 1; margin-bottom: 12px; }
.receipt { text-align: left; margin-top: 20px; }
.receipt dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0; }
.receipt dt { font-weight: 700; }
.receipt dd { margin: 0; overflow-wrap: anywhere; }
.badge {
  display: inline-block;
  background: var(--accent);
  border: 2px solid var(--ink);
  border-radius: 99px;
  padding: 2px 12px;
  font-weight: 700;
  font-size: 15px;
}

#confetti { position: fixed; inset: 0; pointer-events: none; width: 100%; height: 100%; z-index: 10; }

@media (prefers-reduced-motion: reduce) {
  .step { animation: none; }
  .progress-bar, .star svg { transition: none; }
}
