/* Shared by /redeem, /redeem-return and /open (2026-10-23, H20).
   The brand palette only (righteously-ux-ui-design §1): purple #851291,
   beige #EDE5D3, near-black #222121, warm grey #636160, white. Gold is not
   used (never gold on beige). Cormorant Garamond titles, Pretendard the rest;
   the wordmark in the live pages' Nanum Myeongjo. */
:root {
  --purple: #851291;
  --beige: #EDE5D3;
  --ink: #222121;
  --grey: #636160;
  --white: #FFFFFF;
  --line: rgba(127, 125, 122, 0.70); /* soft grey: decorative only (borders) */
  --error: #A3231F;
  --font-body: "Pretendard", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-title: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --font-wordmark: "Nanum Myeongjo", Georgia, "Times New Roman", serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--beige);
  color: var(--ink);
  font-family: var(--font-body);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}
[hidden] { display: none !important; }
.card {
  background: var(--white);
  border-radius: 20px;
  width: 100%;
  max-width: 420px;
  padding: 36px 28px 32px;
  text-align: center;
}
.brand { display: flex; flex-direction: column; align-items: center; margin-bottom: 24px; }
.dove { width: 56px; height: 56px; display: block; }
.wordmark {
  font-family: var(--font-wordmark);
  font-weight: 700;
  font-size: 22px;
  letter-spacing: 0.02em;
  color: var(--purple);
  margin-top: 6px;
}
h1, h2 {
  font-family: var(--font-title);
  font-weight: 700;
  color: var(--ink);
  line-height: 1.2;
  text-wrap: balance;
}
h1 { font-size: 32px; margin: 0 0 12px; }
h2 { font-size: 26px; margin: 0 0 10px; }
/* Main lines in near-black; warm grey ONLY for the small helper lines (.small),
   ruled 10-23. */
p {
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  margin: 0 0 10px;
  text-wrap: pretty;
}
.account { color: var(--ink); font-weight: 500; }
/* The email breaks only at the <wbr> after the @ (redeem.js), never mid-word. */
.email { overflow-wrap: break-word; }  /* after @ / before dots first (redeem.js); mid-word only if one piece cannot fit */
.small { font-size: 14px; margin-top: 14px; color: var(--grey); }
form { margin-top: 20px; text-align: left; }
label { display: block; font-size: 14px; font-weight: 600; color: var(--ink); margin-bottom: 6px; }
textarea#code {
  width: 100%;
  font-family: var(--font-body);
  font-size: 18px;            /* 16px+ stops iOS zooming the field */
  letter-spacing: 0.04em;
  line-height: 1.35;
  padding: 13px 14px;
  resize: none;
  overflow: hidden;            /* it grows instead (redeem.js growCode) */
  word-break: normal;          /* a long code wraps at its hyphens first... */
  overflow-wrap: anywhere;     /* ...and mid-segment only when one segment cannot fit */
  display: block;
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--white);
  color: var(--ink);
}
textarea#code::placeholder { color: var(--grey); letter-spacing: 0; }
textarea#code:focus { outline: none; border-color: var(--purple); box-shadow: 0 0 0 3px rgba(133, 18, 145, 0.15); }
.tick {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;           /* the whole row is the touch target */
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  margin: 0 0 8px;
}
.tick input { width: 24px; height: 24px; margin: 0; accent-color: var(--purple); flex: none; }
/* Errors look like the app's house bar (vc6 house_message_bar.dart: purple
   #851291, white text), not red. */
.msg {
  background: var(--purple);
  color: var(--white);
  font-size: 15px;
  line-height: 1.45;
  border-radius: 12px;
  padding: 12px 14px;
  margin: 4px 0 8px;
  text-align: left;
}
button, .button {
  display: block;
  width: 100%;
  margin-top: 12px;
  background: var(--purple);
  color: var(--white);
  border: none;
  font-family: var(--font-body);
  font-size: 17px;
  font-weight: 600;
  min-height: 52px;
  padding: 14px 24px;
  border-radius: 999px;
  text-decoration: none;
  text-align: center;
  cursor: pointer;
  transition: transform 300ms ease-out;
}
button:active, .button:active { transform: scale(0.97); transition-duration: 100ms; }
button:disabled { background: var(--line); color: var(--white); cursor: default; }
button:focus-visible, .button:focus-visible { outline: 2px solid var(--purple); outline-offset: 3px; }
button.plain { background: transparent; color: var(--purple); }
.badge {
  width: 64px; height: 64px; border-radius: 50%;
  background: var(--purple);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 18px;
}
.badge svg { width: 30px; height: 30px; }
.spinner {
  width: 40px; height: 40px; margin: 12px auto 8px;
  border: 4px solid rgba(133, 18, 145, 0.18);
  border-top-color: var(--purple);
  border-radius: 50%;
  animation: spin 900ms linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.scrim {
  position: fixed; inset: 0;
  background: rgba(34, 33, 33, 0.45);
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
}
.dialog {
  background: var(--beige);
  border-radius: 20px;
  width: 100%; max-width: 380px;
  padding: 28px 24px 20px;
  text-align: center;
}
.dialog p { color: var(--ink); }
.badges { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 18px; }
.badges a { display: inline-block; }
.badges img { height: 44px; width: auto; display: block; }
@media (prefers-reduced-motion: reduce) {
  .spinner { animation-duration: 3s; }
  button, .button { transition: none; }
}
/* The heading takes focus (for screen readers) when a state changes; that
   programmatic focus must not draw a box. Keyboard focus on controls still does. */
h1:focus { outline: none; }

/* NARROW SCREENS / THE LARGEST TEXT (Safari page zoom shrinks the CSS width):
   tighter margins first, then the headings step down a little so a short
   heading stays on one line instead of leaving one word alone. Floor: 26px
   (about 80% of 32px), never smaller. */
@media (max-width: 300px) {
  body { padding: 12px 8px; }
  .card { padding: 24px 10px 22px; border-radius: 16px; }
  h1 { font-size: 26px; }
  h2 { font-size: 22px; }
  .dialog { padding: 22px 16px 16px; }
}
/* Round 2 fixes (10-23):
   - the dialog scrolls inside the screen at the largest text, never off the top;
   - short centred paragraphs balance their lines (no 1–2 word last line);
   - the email sits on its own line (redeem.js), breaking only after the @;
   - at the narrowest widths the box's hint hides (the label above says the
     same words), so the hint is never broken mid-word. */
.scrim { align-items: safe center; overflow-y: auto; }
.dialog { margin: auto; }
.card > section > p, .card > p, .dialog p { text-wrap: balance; }
textarea#code:placeholder-shown { word-break: normal; }
@media (max-width: 300px) {
  textarea#code::placeholder { color: transparent; }
}
