/* /questions: Eric's four questions after an order. Standalone on purpose:
   no site chrome, no trackers, just the note and the form. */

:root {
  --paper: #faf7ef;
  --card: #fffefb;
  --ink: #123f4a;
  --heading: #717576;
  --text: #646869;
  --muted: #8a8e8f;
  --line: #d8e4e8;
  --line-soft: #e8eef0;
  --action: #5b9db9;
  --action-hover: #4b8ca8;
  --action-press: #437f99;
  --wash: #e6f0f3;
  --sand: #eadcc6;
  --danger: #a5523c;
  --display: "Fraunces Refined", Georgia, serif;
  --font: "DM Sans", system-ui, -apple-system, sans-serif;
  --mono: "DM Mono", ui-monospace, Menlo, monospace;
  --ease: cubic-bezier(.2, .8, .2, 1);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }

.q-top { display: flex; justify-content: center; padding: 34px 16px 0; }
.q-top img { width: auto; height: 20px; display: block; }

.q-main { width: 100%; max-width: 640px; margin: 0 auto; padding: 40px 16px 96px; }

/* ---------- Intro, like a note ---------- */
.q-intro { margin: 0 0 40px; padding: 0 4px; }
.q-intro :is(h1, h2) {
  margin: 0 0 22px;
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(38px, 8vw, 54px);
  line-height: 1.04;
  letter-spacing: -0.02em;
  color: var(--heading);
  text-wrap: balance;
}
.q-intro :is(h1, h2) em { font-style: italic; color: var(--ink); }
.q-intro p { margin: 0 0 12px; max-width: 34em; }
.q-sign { margin-top: 22px !important; font-size: 14px; color: var(--muted); }
.q-sign span {
  display: block;
  font-family: var(--display);
  font-style: italic;
  font-size: 28px;
  line-height: 1.1;
  color: var(--ink);
}

/* ---------- Question cards ---------- */
.q-form { display: grid; gap: 14px; }
.q-card {
  margin: 0;
  min-width: 0;
  padding: 24px 24px 18px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 22px;
  transition: border-color .4s var(--ease), box-shadow .4s var(--ease);
}
.q-card:focus-within { border-color: #b9d3dd; box-shadow: 0 14px 40px -28px rgba(18, 63, 74, .45); }
.q-card.is-missing { border-color: var(--danger); }
.q-optional { margin-left: 8px; color: var(--muted); letter-spacing: .04em; }
.q-card legend {
  float: left;
  width: 100%;
  padding: 0;
  margin: 0 0 14px;
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(21px, 4.6vw, 24px);
  line-height: 1.22;
  letter-spacing: -0.01em;
  color: var(--heading);
}
.q-card legend + * { clear: both; }
.q-num {
  display: block;
  margin-bottom: 8px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .08em;
  color: var(--action);
}

textarea {
  display: block;
  width: 100%;
  min-height: 44px;
  margin: 0;
  padding: 10px 0 8px;
  border: 0;
  border-bottom: 1px solid var(--line-soft);
  border-radius: 0;
  background: transparent;
  color: #3f4546;
  font: inherit;
  font-size: 17px;
  line-height: 1.55;
  resize: none;
  overflow: hidden;
  outline: none;
  transition: border-color .3s var(--ease);
}
textarea::placeholder { color: #a9adae; }
textarea:focus { border-bottom-color: var(--action); }

/* ---------- Chips ---------- */
.q-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 10px; }
.q-chip {
  appearance: none;
  padding: 8px 15px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 15px;
  line-height: 1.2;
  cursor: pointer;
  transition: background .25s var(--ease), border-color .25s var(--ease), color .25s var(--ease);
}
.q-chip:hover { border-color: #b9d3dd; background: rgba(230, 240, 243, .6); }
.q-chip[aria-checked="true"] { background: var(--action); border-color: var(--action); color: #fff; }
.q-chip:focus-visible, .q-submit:focus-visible, .q-copy:focus-visible, .q-link:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }

.q-chat {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  padding: 18px 24px;
  border: 1px dashed var(--line);
  border-radius: 22px;
}
.q-chat p { margin: 0; color: var(--heading); }
.q-chat .q-chips { margin: 0; }

/* ---------- Submit ---------- */
.q-submit {
  appearance: none;
  width: 100%;
  margin-top: 10px;
  padding: 19px 24px;
  border: 0;
  border-radius: 999px;
  background: var(--action);
  color: #fff;
  font: inherit;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: .01em;
  cursor: pointer;
  transition: background .25s var(--ease), transform .25s var(--ease);
}
.q-submit:hover { background: var(--action-hover); }
.q-submit:active { background: var(--action-press); transform: scale(.995); }
.q-submit[disabled] { opacity: .7; cursor: progress; }

.q-error { margin: 4px 4px 0; color: var(--danger); font-size: 15px; }
.q-quiet { margin: 6px 0 0; font-size: 14px; color: var(--muted); }
.q-center { text-align: center; }

/* ---------- The code ---------- */
.q-intro-done { text-align: center; }
.q-intro-done p { margin-left: auto; margin-right: auto; }
.q-ticket {
  position: relative;
  margin: 0 0 30px;
  padding: 34px 24px 28px;
  border-radius: 26px;
  background: var(--wash);
  text-align: center;
}
.q-ticket::before, .q-ticket::after {
  /* Ticket notches */
  content: "";
  position: absolute;
  top: 50%;
  width: 22px;
  height: 22px;
  margin-top: -11px;
  border-radius: 50%;
  background: var(--paper);
}
.q-ticket::before { left: -11px; }
.q-ticket::after { right: -11px; }
.q-ticket-label { margin: 0 0 10px; font-family: var(--mono); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink); }
.q-code {
  margin: 0 0 20px;
  font-family: var(--mono);
  font-weight: 500;
  font-size: clamp(28px, 8vw, 40px);
  letter-spacing: .06em;
  color: var(--ink);
  user-select: all;
  word-break: break-all;
}
.q-copy {
  appearance: none;
  padding: 12px 24px;
  border: 0;
  border-radius: 999px;
  background: var(--action);
  color: #fff;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background .25s var(--ease);
}
.q-copy:hover { background: var(--action-hover); }
.q-ticket-note { margin: 16px auto 0; max-width: 26em; font-size: 14px; color: var(--text); }
.q-link { color: var(--ink); font-weight: 600; text-decoration: none; border-bottom: 1px solid var(--line); padding-bottom: 2px; }
.q-link:hover { border-bottom-color: var(--ink); }

.q-visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Motion: slow and small ---------- */
@media (prefers-reduced-motion: no-preference) {
  .q-state:not([hidden]) > * { animation: q-rise .9s var(--ease) both; }
  .q-state:not([hidden]) .q-form > * { animation: q-rise .9s var(--ease) both; }
  .q-form > :nth-child(1) { animation-delay: .12s !important; }
  .q-form > :nth-child(2) { animation-delay: .18s !important; }
  .q-form > :nth-child(3) { animation-delay: .24s !important; }
  .q-form > :nth-child(4) { animation-delay: .30s !important; }
  .q-form > :nth-child(n+5) { animation-delay: .36s !important; }
  .q-ticket { animation-delay: .1s !important; }
}
@keyframes q-rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

@media (max-width: 520px) {
  .q-top { padding-top: 26px; }
  .q-main { padding-top: 30px; }
  .q-card { padding: 20px 18px 14px; border-radius: 20px; }
  .q-chat { padding: 16px 18px; }
  .q-chip { font-size: 14px; padding: 8px 13px; }
}
