/* Built for a 64-year-old reading on a phone, possibly without their glasses.
   Every size here is larger than a normal site, on purpose. Nothing is grey on
   grey, nothing is smaller than 18px, and every tap target clears 56px. */

:root {
  --ink: #1a1a1a;
  --ink-soft: #4a4a4a;
  --paper: #fdfcfa;
  --line: #d6d0c8;
  --accent: #1c5c4a;
  --accent-dark: #123f33;
  --warn: #8a2e1e;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #f2efe9;
    --ink-soft: #c3bdb3;
    --paper: #17181a;
    --line: #3d3f43;
    --accent: #5fbfa3;
    --accent-dark: #7fd4bb;
    --warn: #f0a08c;
  }
}

* {
  box-sizing: border-box;
}

/* Percentages, not pixels, and this matters more than it looks. A fixed px size
   here overrides the reader's own text-size setting - so someone who has already
   gone into their phone and made text bigger would be ignored by this page.
   125% of their chosen default is our starting point, not our final say. */
html {
  font-size: 125%;
}

@media (min-width: 40rem) {
  html {
    font-size: 131%;
  }
}

body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Georgia, "Iowan Old Style", "Times New Roman", serif;
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
}

#app {
  max-width: 34rem;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 4rem;
}

.screen {
  animation: fade 0.25s ease-out;
}

@keyframes fade {
  from {
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .screen {
    animation: none;
  }
}

/* --- type --- */

h1 {
  font-size: 1.6rem;
  line-height: 1.25;
  margin: 0 0 1rem;
}

h2 {
  font-size: 1.15rem;
  line-height: 1.3;
  margin: 2rem 0 0.5rem;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--ink-soft);
  font-size: 0.85rem;
}

p {
  margin: 0 0 1rem;
}

.lede {
  font-size: 1.05rem;
}

.help {
  color: var(--ink-soft);
  font-size: 0.9rem;
  margin: 0 0 1.25rem;
}

.progress {
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 0 0 1.5rem;
}

/* --- inputs --- */

label {
  display: block;
}

textarea,
input[type="text"],
input[type="email"] {
  width: 100%;
  font-family: inherit;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--ink);
  background: var(--paper);
  border: 2px solid var(--line);
  border-radius: 8px;
  padding: 0.75rem;
}

textarea {
  min-height: 8rem;
  resize: vertical;
}

input[type="text"],
input[type="email"] {
  min-height: 3.25rem;
}

textarea:focus,
input:focus,
button:focus,
.choice:focus-within {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.field {
  margin: 0 0 1.5rem;
}

.field-label {
  font-size: 1rem;
  margin: 0 0 0.4rem;
}

/* Set apart above the rule, so the reader who has no code reads it once,
   sees it does not apply, and carries on. */
.access-code {
  border-top: 1px solid var(--line);
  padding-top: 1.5rem;
}

/* Choice list: whole row is the tap target, not just the little circle. */

.choice {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 3.5rem;
  padding: 0.75rem 1rem;
  margin: 0 0 0.75rem;
  border: 2px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
}

.choice input {
  width: 1.5rem;
  height: 1.5rem;
  accent-color: var(--accent);
  flex: none;
}

.choice:has(input:checked) {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, transparent);
}

/* --- buttons --- */

.actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  margin-top: 1.5rem;
}

button {
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 1rem;
  min-height: 3.5rem;
  padding: 0 1.5rem;
  border-radius: 8px;
  border: 2px solid transparent;
  cursor: pointer;
}

.primary {
  background: var(--accent);
  color: #fff;
  flex: 1;
}

@media (prefers-color-scheme: dark) {
  .primary {
    color: #10221d;
  }
}

.primary:hover {
  background: var(--accent-dark);
}

.secondary {
  background: transparent;
  color: var(--ink-soft);
  border-color: var(--line);
}

.secondary:hover {
  color: var(--ink);
  border-color: var(--ink-soft);
}

/* --- messages --- */

.error {
  color: var(--warn);
  font-weight: bold;
  margin: 0 0 1rem;
}

.waiting {
  text-align: center;
  padding: 4rem 0;
}

.dots::after {
  content: "";
  animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
  0% {
    content: "";
  }
  25% {
    content: ".";
  }
  50% {
    content: "..";
  }
  75% {
    content: "...";
  }
}

@media (prefers-reduced-motion: reduce) {
  .dots::after {
    content: "...";
    animation: none;
  }
}

/* --- result --- */

.kit-section {
  border-top: 1px solid var(--line);
  padding-top: 0.5rem;
}

.topic {
  font-size: 1.25rem;
  line-height: 1.4;
}

ul {
  padding-left: 1.25rem;
  margin: 0 0 1rem;
}

li {
  margin-bottom: 0.75rem;
}

.email-block {
  border-left: 3px solid var(--line);
  padding-left: 1rem;
  margin-bottom: 1.5rem;
}

.email-subject {
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 0.9rem;
  color: var(--ink-soft);
}

/* A link that has to look and behave like a button - it's the one thing on the
   result page we actually want tapped. */
.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3.5rem;
  padding: 0 1.5rem;
  margin-top: 0.5rem;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 1rem;
  text-decoration: none;
}

@media (prefers-color-scheme: dark) {
  .button-link {
    color: #10221d;
  }
}

.button-link:hover {
  background: var(--accent-dark);
}

.button-link:focus {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.next-step {
  margin-top: 2.5rem;
  padding: 1.25rem;
  border: 2px solid var(--accent);
  border-radius: 8px;
}

/* Looks like a heading, but is an h2 - the page already has its one h1, and a
   second one reads as a second page to a screen reader. */
.next-step-title {
  font-family: Georgia, "Iowan Old Style", "Times New Roman", serif;
  font-size: 1.4rem;
  line-height: 1.25;
  text-transform: none;
  letter-spacing: normal;
  color: var(--ink);
  margin: 0 0 0.75rem;
}
