:root {
  --sky: #ede7ff;
  --paper: #ffffff;
  --ink: #3a1f4b;
  --ink-soft: #6b5478;
  --bubblegum: #ff7aa8;
  --bubblegum-soft: #ffe0eb;
  --mint: #6fd6be;
  --mint-soft: #dcf6ef;
  --butter: #ffd966;
  --line: 2.5px solid var(--ink);
  --pop: 4px 4px 0 var(--ink);
  --display: "Baloo 2", "Arial Rounded MT Bold", "Trebuchet MS", sans-serif;
  --body: "Nunito", "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% 18%, #fff 0 2px, transparent 3px) 0 0 / 46px 46px,
    var(--sky);
  color: var(--ink);
  font: 400 1.0625rem/1.6 var(--body);
}

h1, h2, h3 { font-family: var(--display); line-height: 1.15; margin: 0 0 .4em; }
h1 { font-size: clamp(2rem, 6vw, 2.75rem); font-weight: 800; }
h2 { font-size: 1.6rem; font-weight: 700; }
p { margin: 0 0 1em; }
a { color: var(--ink); text-decoration-color: var(--bubblegum); text-decoration-thickness: 3px; text-underline-offset: 3px; }

:focus-visible { outline: 3px dashed var(--bubblegum); outline-offset: 3px; }

.wrap { width: 100%; max-width: 46rem; margin: 0 auto; padding-inline: 1.25rem; }

/* Auth pages */
.auth {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 2rem 1.25rem;
}
.auth-box { width: 100%; max-width: 24rem; text-align: center; }
.auth-box form {
  margin-top: 1rem;
  padding: 1.5rem;
  background: var(--paper);
  border: var(--line);
  border-radius: 28px;
  box-shadow: var(--pop);
  text-align: left;
}
/* The art has a flat lavender ground; fading its edges hides the seam against the dotted page. */
.couple {
  width: min(17rem, 80%);
  height: auto;
  display: block;
  margin: 0 auto;
  --fade-x: linear-gradient(to right, transparent, #000 8%, #000 92%, transparent);
  --fade-y: linear-gradient(to bottom, transparent, #000 8%, #000 92%, transparent);
  -webkit-mask-image: var(--fade-x), var(--fade-y);
  -webkit-mask-composite: source-in;
  mask-image: var(--fade-x), var(--fade-y);
  mask-composite: intersect;
}

label.field { display: block; font-weight: 700; margin-bottom: 1rem; }
label.field span { display: block; margin-bottom: .3rem; }
input[type="text"], input[type="password"], textarea {
  width: 100%;
  font: inherit;
  color: inherit;
  padding: .7rem .9rem;
  border: var(--line);
  border-radius: 14px;
  background: #fffafc;
}
textarea { min-height: 7rem; resize: vertical; }
input:focus, textarea:focus { outline: none; box-shadow: 0 0 0 4px var(--bubblegum-soft); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  font: 700 1.05rem var(--display);
  color: var(--ink);
  background: var(--bubblegum);
  border: var(--line);
  border-radius: 999px;
  padding: .6rem 1.4rem;
  box-shadow: var(--pop);
  cursor: pointer;
  text-decoration: none;
  transition: transform .08s, box-shadow .08s;
}
.btn:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--ink); }
.btn[disabled] { opacity: .6; cursor: progress; }
.btn.full { width: 100%; }
.btn.quiet { background: var(--paper); }
.btn.mint { background: var(--mint); }

.error {
  min-height: 1.5em;
  margin: .25rem 0 .75rem;
  color: #b0124f;
  font-weight: 700;
}

/* Signed-in pages */
.topbar {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 5;
  background: var(--sky);
  border-bottom: var(--line);
}
.topbar .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-block: .6rem; }
.brand { font: 800 1.35rem var(--display); text-decoration: none; display: inline-flex; align-items: center; gap: .4rem; }
.brand svg { width: 1.6rem; height: 1.6rem; }
.who { display: flex; align-items: center; gap: .75rem; font-weight: 700; }
.linkish { background: none; border: 0; padding: 0; font: inherit; color: var(--ink); text-decoration: underline; text-decoration-color: var(--bubblegum); text-decoration-thickness: 3px; text-underline-offset: 3px; cursor: pointer; }

main { padding-block: 2rem 4rem; }

.hello { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 1rem; }
.hello .couple { width: 9rem; }
@media (max-width: 34rem) { .hello { grid-template-columns: 1fr; } .hello .couple { margin: 0; } }

.banner {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1024 / 572;
  object-fit: cover;
  margin-bottom: 1.25rem;
  background: var(--paper);
  border: var(--line);
  border-radius: 22px;
  box-shadow: var(--pop);
}

.big-link {
  display: block;
  margin-top: 1.5rem;
  padding: 1.25rem 1.5rem;
  background: var(--butter);
  border: var(--line);
  border-radius: 22px;
  box-shadow: var(--pop);
  text-decoration: none;
  font: 700 1.4rem var(--display);
}
.big-link small { display: block; font: 400 1rem var(--body); color: var(--ink-soft); }

.form-choice { display: grid; gap: 1.25rem; margin-top: 1.5rem; }
.form-choice article {
  padding: 1.25rem 1.5rem;
  background: var(--paper);
  border: var(--line);
  border-radius: 22px;
  box-shadow: var(--pop);
}
.form-choice article:nth-child(2) { background: var(--mint-soft); }
.form-choice .meta { color: var(--ink-soft); margin-bottom: .75rem; }
.form-choice .actions { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; }

/* Form pages */
.trail { display: flex; flex-wrap: wrap; gap: .3rem; margin: .25rem 0 0; padding: 0; list-style: none; }
.trail a { display: block; width: 1.35rem; height: 1.35rem; }
.trail svg { width: 100%; height: 100%; }
.trail path { fill: var(--paper); stroke: var(--ink); stroke-width: 2.5; }
.trail .done path { fill: var(--mint); }
.trail .current path { fill: var(--bubblegum); }

.section-head { margin: 1.5rem 0 1rem; }
.section-head .count { color: var(--ink-soft); font-weight: 700; margin-bottom: .2rem; }
.section-head p { color: var(--ink-soft); }

.intro { background: var(--paper); border: var(--line); border-radius: 22px; padding: 1rem 1.25rem; margin-bottom: 1.5rem; }
.intro ul { margin: 0; padding-left: 1.2rem; }

.q { padding: 1.5rem 0; border-top: 2.5px dashed #c9b8d6; }
.q:first-of-type { border-top: 0; }
.q legend, .q .q-title { font-weight: 800; font-size: 1.1rem; padding: 0; margin-bottom: .6rem; }
.q fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.q .tag { display: inline-block; font: 700 .8rem var(--body); background: var(--butter); border: 2px solid var(--ink); border-radius: 999px; padding: 0 .55rem; margin-right: .4rem; vertical-align: .15em; }
.q .hint { color: var(--ink-soft); font-size: .95rem; margin: -.3rem 0 .6rem; }
.q.missing { background: linear-gradient(90deg, var(--bubblegum-soft), transparent); border-radius: 12px; padding-inline: .75rem; }
.q.missing .q-title::after, .q.missing legend::after { content: " — needs an answer"; color: #b0124f; font-weight: 700; font-size: .9rem; }

.options { display: flex; flex-wrap: wrap; gap: .5rem; }
.options label { position: relative; }
.options input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.options span {
  display: inline-block;
  padding: .45rem .95rem;
  border: 2px solid var(--ink);
  border-radius: 18px;
  background: var(--paper);
  line-height: 1.35;
}
.options input:checked + span { background: var(--bubblegum); box-shadow: 2px 2px 0 var(--ink); font-weight: 700; }
.options input[type="checkbox"]:checked + span { background: var(--mint); }
.options input:focus-visible + span { outline: 3px dashed var(--bubblegum); outline-offset: 2px; }

.scale { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.scale .options span { width: 2.6rem; height: 2.6rem; padding: 0; border-radius: 50%; display: grid; place-items: center; font-weight: 800; }
.scale small { color: var(--ink-soft); }

.pager { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-top: 2rem; flex-wrap: wrap; }
.saved { color: var(--ink-soft); font-size: .95rem; }

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(1.25rem + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  background: var(--ink);
  color: #fff;
  padding: .7rem 1.2rem;
  border-radius: 999px;
  font-weight: 700;
  z-index: 10;
}

/* Submissions */
.list { list-style: none; margin: 1.25rem 0 0; padding: 0; display: grid; gap: .75rem; }
.list a { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding: .9rem 1.2rem; background: var(--paper); border: var(--line); border-radius: 18px; text-decoration: none; font-weight: 700; }
.list a:hover { background: var(--bubblegum-soft); }
.list time { color: var(--ink-soft); font-weight: 400; }
.empty { margin-top: 1.5rem; }

.answer-opts { display: flex; flex-wrap: wrap; gap: .4rem; }
.answer-opts span { padding: .3rem .8rem; border: 2px solid #c9b8d6; border-radius: 16px; color: var(--ink-soft); }
.answer-opts span.picked { border-color: var(--ink); background: var(--bubblegum); color: var(--ink); font-weight: 700; }
.answer-text { white-space: pre-wrap; background: var(--paper); border: 2px solid var(--ink); border-radius: 14px; padding: .6rem .9rem; }
.answer-none { color: var(--ink-soft); font-style: italic; }

.loading { color: var(--ink-soft); }
