/*
 * The site's type and colour, lifted from the app rather than reinvented.
 *
 * Every value here is the same number the app ships: `lib/domain/src/theme.ts`
 * defines these as HSL triples and they are written out in the same form, so a
 * change to the brand can be carried across by eye without converting hexes.
 * Someone who installs the app after reading this page should not feel that
 * they have arrived somewhere else.
 */
:root {
  --cream: hsl(34 100% 97%);
  --espresso: hsl(82 4% 20%);
  --muted-ink: hsl(82 4% 45%);
  --coral: hsl(9 72% 62%);
  --coral-deep: hsl(9 62% 52%);
  --sage: hsl(147 19% 55%);
  --gold: hsl(39 46% 60%);
  --oat: hsl(32 45% 91%);
  --line: hsl(32 45% 85%);
  --card: #fff;

  --serif: "Playfair Display", Georgia, "Times New Roman", serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --radius-card: 24px;
  --shell: 1080px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--cream);
  color: var(--espresso);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-family: var(--serif); font-weight: 700; line-height: 1.15; margin: 0; }
h1 { font-size: clamp(2.4rem, 6vw, 4rem); letter-spacing: -0.01em; }
h2 { font-size: clamp(1.8rem, 4vw, 2.6rem); }
h3 { font-size: 1.3rem; font-weight: 600; }
p { margin: 0; }
a { color: inherit; }

.shell { width: 100%; max-width: var(--shell); margin: 0 auto; padding: 0 24px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px; padding: 15px 30px; border: 0; border-radius: 999px;
  background: var(--coral); color: #fff;
  font-family: var(--sans); font-size: 1rem; font-weight: 600;
  text-decoration: none; cursor: pointer;
  transition: background 140ms ease, transform 140ms ease;
}
.btn:hover { background: var(--coral-deep); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; }
.btn-ghost {
  background: transparent; color: var(--espresso);
  border: 1px solid var(--line); padding: 12px 22px;
}
.btn-ghost:hover { background: var(--oat); }
.btn-wide { width: 100%; }

/* ---------- landing ---------- */
/*
 * One column, centred, and short enough that nothing needs scrolling past to
 * reach the point. The previous version was three sections of prose, which is
 * a blog post wearing a landing page's clothes.
 */
body.landing {
  min-height: 100vh;
  display: grid;
  grid-template-rows: 1fr auto;
  padding: 32px 24px 40px;
  text-align: center;
}
body.landing main {
  display: grid; align-content: center; justify-items: center;
  gap: 22px; max-width: 30ch; margin: 0 auto;
}
body.landing .mark { width: 82px; height: 82px; border-radius: 20px; }
body.landing h1 { font-size: clamp(2.6rem, 9vw, 4rem); }
body.landing .tagline {
  font-size: clamp(1.05rem, 3.4vw, 1.25rem);
  color: var(--muted-ink); line-height: 1.45;
}
body.landing .points {
  list-style: none; padding: 0; margin: 6px 0 0;
  display: grid; gap: 10px; font-size: 1rem;
}
body.landing .points li { padding-top: 10px; border-top: 1px solid var(--line); }
body.landing .points li:first-child { border-top: 0; padding-top: 0; }

body.landing .tail { display: grid; justify-items: center; gap: 18px; padding-top: 40px; }
body.landing .tail .mail { color: var(--muted-ink); font-size: 0.88rem; text-decoration: none; }
body.landing .tail .mail:hover { text-decoration: underline; }

/* ---------- forms ---------- */
.form-page { min-height: 100vh; display: grid; align-content: start; }
.form-wrap { max-width: 560px; margin: 0 auto; padding: 24px 24px 72px; width: 100%; }
.field { display: grid; gap: 7px; margin-bottom: 18px; }
.field label { font-size: 0.92rem; font-weight: 600; }
.field input, .field select {
  font-family: var(--sans); font-size: 1rem; color: var(--espresso);
  padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px;
  background: var(--card); width: 100%;
}
.field input:focus, .field select:focus { outline: 2px solid var(--coral); outline-offset: 1px; }
.field .hint { font-size: 0.84rem; color: var(--muted-ink); }
.row { display: grid; gap: 18px; grid-template-columns: 1fr 1fr; }
@media (max-width: 520px) { .row { grid-template-columns: 1fr; gap: 0; } }

.consent { display: flex; gap: 12px; align-items: flex-start; margin: 6px 0 22px; }
.consent input { margin-top: 4px; width: 18px; height: 18px; flex: none; accent-color: var(--coral); }
.consent label { font-size: 0.9rem; color: var(--muted-ink); }

.status { margin-top: 16px; font-size: 0.95rem; min-height: 1.4em; }
.status.err { color: hsl(356 88% 42%); }
.status.ok { color: hsl(147 90% 26%); }

.done { display: none; text-align: center; padding: 40px 0; gap: 16px; }
.done img { width: 72px; height: 72px; border-radius: 18px; margin: 0 auto 8px; display: block; }
.done p { color: var(--muted-ink); }

/* ---------- qr ---------- */
.qr-page { min-height: 100vh; display: grid; place-items: center; padding: 40px 24px; }
.qr-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 32px;
  padding: 44px; max-width: 460px; width: 100%; text-align: center; display: grid; gap: 18px;
}
.qr-card img.code {
  width: 100%; max-width: 300px; margin: 0 auto; display: block;
  border-radius: 12px; image-rendering: pixelated;
}
.qr-card .url {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.9rem; color: var(--muted-ink); word-break: break-all;
}
@media print {
  body { background: #fff; }
  .qr-card { border: 0; box-shadow: none; padding: 0; }
  .no-print { display: none !important; }
}
