/* Registering and the privacy notice: a sheet of the notebook, with the form on a slip taped onto it. */

@font-face { font-family: "Libre Caslon Display"; src: url("../fonts/libre-caslon-display-latin-400-normal.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Libre Caslon Display"; src: url("../fonts/libre-caslon-display-latin-ext-400-normal.woff2") format("woff2"); font-display: swap; unicode-range: U+0100-02AF, U+1E00-1E9F, U+20A0-20AB, U+2113; }
@font-face { font-family: "Libre Caslon Text"; src: url("../fonts/libre-caslon-text-latin-400-normal.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Libre Caslon Text"; src: url("../fonts/libre-caslon-text-latin-ext-400-normal.woff2") format("woff2"); font-display: swap; unicode-range: U+0100-02AF, U+1E00-1E9F, U+20A0-20AB, U+2113; }
@font-face { font-family: "Libre Caslon Text"; src: url("../fonts/libre-caslon-text-latin-400-italic.woff2") format("woff2"); font-style: italic; font-display: swap; }
@font-face { font-family: "Pinyon Script"; src: url("../fonts/pinyon-script-latin-400-normal.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Kalam"; src: url("../fonts/kalam-latin-400-normal.woff2") format("woff2"); font-display: swap; }

:root {
  --paper: #f7f1e3; --slip: #fcf9f1; --text: #16223f; --soft: #3a4566; --pen: #1b2a6b; --ball: #2a47b0;
  --rule: rgba(29, 47, 107, 0.6); --line: rgba(29, 47, 107, 0.3); --bad: #a3271b; --good: #22653d;
  color-scheme: light;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0; min-height: 100svh; display: flex; flex-direction: column;
  color: var(--text); background-color: var(--paper);
  background-image: linear-gradient(rgba(110, 150, 205, 0.2) 1px, transparent 1px), linear-gradient(90deg, rgba(110, 150, 205, 0.2) 1px, transparent 1px);
  background-size: 26px 26px; background-position: center top;
  font: 400 1.04rem/1.55 "Libre Caslon Text", Georgia, serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--ball); text-underline-offset: 0.2em; }
:focus-visible { outline: 2px solid var(--ball); outline-offset: 2px; border-radius: 4px; }

.top { display: flex; align-items: center; gap: 16px; padding: 10px clamp(12px, 2vw, 24px); border-bottom: 1px solid rgba(29, 47, 107, 0.14); background: rgba(247, 241, 227, 0.9); }
.top p { margin: 0; }
.top__home { display: inline-flex; align-items: center; gap: 5px; font: 400 1.2rem/1 "Libre Caslon Display", serif; color: var(--text); text-decoration: none; padding: 6px 8px 6px 2px; }
.top__home svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.top__free { margin-left: auto !important; font-style: italic; color: var(--soft); }
.top__emu { padding: 2px 10px; border-radius: 999px; background: #fbe3b4; font-size: 0.85rem; }

main { flex: 1; width: min(100% - 32px, 62rem); margin: 0 auto; padding: clamp(20px, 5vh, 56px) 0 64px; }
.pen { margin: 0; font-family: "Pinyon Script", "Snell Roundhand", cursive; font-weight: 400; color: var(--pen); line-height: 1.1; text-wrap: balance; }
.head { max-width: 46rem; margin: 0 auto clamp(20px, 4vh, 40px); text-align: center; }
.head h1 { font-size: clamp(2.6rem, 6.4vw, 4.6rem); }
.lede { margin: 0.3em auto 0; max-width: 46ch; color: var(--soft); font-size: clamp(1.02rem, 1.5vw, 1.18rem); text-wrap: pretty; }
.steps { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 28px; margin: 18px 0 0; padding: 0; list-style: none; counter-reset: s; font-family: "Kalam", cursive; color: rgba(42, 71, 176, 0.75); }
.steps li { counter-increment: s; }
.steps li::before { content: counter(s) ". "; }
.steps li[aria-current] { color: var(--pen); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 0.28em; }
.steps li.is-past { text-decoration: line-through; }

.slip {
  position: relative; display: block; margin: 0 auto; padding: clamp(26px, 4vw, 44px);
  background: var(--slip); border-radius: 3px;
  box-shadow: 0 1px 2px rgba(22, 34, 63, 0.12), 0 22px 44px -20px rgba(22, 34, 63, 0.5);
}
.slip::before {
  content: ""; position: absolute; top: -13px; left: 50%; width: 104px; height: 26px; translate: -50% 0; rotate: -2deg;
  background: repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.16) 0 2px, transparent 2px 6px), rgba(233, 223, 191, 0.86);
  clip-path: polygon(3% 0, 97% 3%, 100% 26%, 97% 50%, 100% 76%, 97% 100%, 3% 97%, 0 74%, 3% 50%, 0 24%);
}
.slip--narrow { max-width: 34rem; }
.slip--narrow h2 { font-size: clamp(2.2rem, 4vw, 3rem); margin-bottom: 0.2em; }
.slip--plain { max-width: 34rem; text-align: center; }
.cols { display: grid; grid-template-columns: 1fr 1.15fr; gap: 12px clamp(24px, 5vw, 64px); align-items: start; }
fieldset.plain { margin: 0; padding: 0; border: 0; min-width: 0; }
fieldset.plain legend { padding: 0; margin-bottom: 0.25em; font-size: clamp(2rem, 3.2vw, 2.6rem); }
.invited { margin: 0 0 20px; padding: 10px 16px; border-left: 3px solid var(--ball); background: rgba(42, 71, 176, 0.07); }
.say { margin: 0 0 1em; }

.field { margin: 0 0 16px; }
.field label { display: block; margin-bottom: 4px; }
.field input, .pw input {
  width: 100%; min-height: 44px; padding: 8px 12px;
  font: 400 1.02rem/1.3 "Libre Caslon Text", Georgia, serif; color: var(--text);
  background: #fff; border: 1px solid var(--line); border-radius: 6px;
}
.field input::placeholder { color: rgba(58, 69, 102, 0.62); font-style: italic; }
.field input:focus { outline: 2px solid var(--ball); outline-offset: 1px; border-color: transparent; }
.field input[aria-invalid] { border-color: var(--bad); }
.hint { margin: 4px 0 0; font-size: 0.9rem; line-height: 1.4; color: var(--soft); }
.err { margin: 4px 0 0; font-size: 0.92rem; line-height: 1.4; color: var(--bad); }
.err:empty, .msg:empty, .say:empty, .lede:empty { display: none; }
.pw { position: relative; }
.pw input { padding-right: 70px; }
.pw__show { position: absolute; top: 5px; right: 5px; min-height: 34px; padding: 0 12px; border: 0; border-radius: 4px; background: none; font: inherit; font-size: 0.9rem; color: var(--ball); cursor: pointer; }
.pw__show:hover { background: rgba(42, 71, 176, 0.08); }

.choice { margin: 0 0 8px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px; transition: border-color 0.2s ease, background-color 0.2s ease; }
.choice.is-on { border-color: var(--ball); background: rgba(42, 71, 176, 0.05); }
.choice { display: grid; grid-template-columns: auto 1fr; gap: 0 12px; align-items: start; }
.choice > input { width: 20px; height: 20px; margin: 3px 0 0; accent-color: var(--ball); }
.choice > label { cursor: pointer; }
.choice > label b { display: block; font-weight: 400; color: var(--pen); }
.choice > label span { display: block; font-size: 0.92rem; line-height: 1.4; color: var(--soft); }
.choice .more { grid-column: 1 / -1; display: none; margin-top: 12px; }
.choice.is-on .more { display: block; }
.choice .more .field { margin: 0; }

.agree { display: grid; grid-template-columns: auto 1fr; gap: 0 12px; align-items: start; margin: 20px 0 0; padding-top: 18px; border-top: 1px solid rgba(29, 47, 107, 0.18); }
.agree input { width: 20px; height: 20px; margin: 3px 0 0; accent-color: var(--ball); }
.agree .err { grid-column: 2; }
.msg { margin: 16px 0 0; color: var(--bad); }
.msg.good { color: var(--good); }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; margin-top: 20px; }
.btn {
  min-height: 46px; padding: 0 26px; border: 0; border-radius: 999px; cursor: pointer;
  font: 400 1.04rem/1 "Libre Caslon Text", Georgia, serif; color: #f7f1e3; background: #1f3a8a;
  transition: background-color 0.2s ease;
}
.btn:hover { background: #2a47b0; }
.btn--a { display: inline-flex; align-items: center; text-decoration: none; }
#title:focus { outline: none; }
.field input[readonly] { background: transparent; border-style: dashed; color: var(--soft); }
.btn:disabled { opacity: 0.65; cursor: progress; }
.btn:focus-visible { outline-offset: 3px; border-radius: 999px; }
.link { padding: 8px 2px; border: 0; background: none; font: italic 400 1rem/1.2 "Libre Caslon Text", Georgia, serif; color: var(--ball); cursor: pointer; text-decoration: none; }
.link:hover { text-decoration: underline; text-underline-offset: 0.25em; }
.next { margin: 24px 0 0; padding: 18px 0 0 1.3em; border-top: 1px solid rgba(29, 47, 107, 0.18); }
.next li { margin-bottom: 6px; padding-left: 4px; }
.next b, .say b { font-weight: 400; font-style: italic; color: var(--pen); }
.quiet { margin: 16px 0 0; }
.loading { text-align: center; font-family: "Kalam", cursive; font-size: 1.2rem; color: var(--ball); }
.foot { padding: 16px; text-align: center; font-size: 0.92rem; color: var(--soft); }

/* the privacy notice */
.notice { max-width: 46rem; }
.notice h2 { margin: 1.1em 0 0.2em; font-size: 2rem; }
.notice h2:first-child { margin-top: 0; }
.notice p, .notice li { max-width: 66ch; }
.notice ul { padding-left: 1.2em; }
.notice .when { color: var(--soft); }

@media (max-width: 759px) {
  .cols { grid-template-columns: 1fr; gap: 20px; }
  .slip { padding: 30px 20px 24px; }
}
@media (prefers-reduced-motion: reduce) { .choice, .btn { transition: none; } }
