/* StoryBook quiz, order and privacy pages: base tokens and chrome.
   Tokens are the landing's (funnel/landing/styles.css), per STYLE-GUIDE.md §1 (07.10). The old Unique-Song orange is retired. */

:root {
  /* DECISIONS-1007 item 16: one design system for the landing and the quiz (funnel/landing/landing.css :root).
     CTA #FF5A36 with white 20 px bold text (large text, 3.1:1); small text links are ink with a CTA underline. */
  --paper: #fff8f2;
  --paper-2: #ffede3;
  --ink: #2b2118;
  --muted: #6b5b53;
  --accent: #ff5a36;
  --accent-hover: #e8482a;
  --accent-ink: #b8361a;
  --line: #f0e2d8;
  --field: #b9a79c;
  --rose: #ff5a36;
  --card: #ffffff;
  --error: #b3261e;
  --ok: #2e8b57;
  --sun: #ffc94d;
  --radius: 16px;
  --serif: "Fredoka", "Nunito", system-ui, -apple-system, sans-serif;
  --sans: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
  --shadow: 0 10px 30px rgba(43, 33, 24, .12);
  --shadow-sm: 0 4px 14px rgba(43, 33, 24, .10);
  /* old names, mapped */
  --sb-bg: #fff8f2;
  --sb-primary: #ff5a36;
  --sb-primary-text: #fff;
  --sb-track-border: #b9a79c;
  --sb-track-fill: #ff5a36;
  --sb-card-bg: #fff;
  --sb-card-text: #2b2118;
  --sb-input-border: #b9a79c;
  --sb-heading: #2b2118;
  --sb-subtitle: #6b5b53;
  --sb-footer-bg: #ffede3;
  --sb-radius: 16px;
  --sb-font-heading: "Fredoka", "Nunito", system-ui, sans-serif;
  --sb-font-body: "Nunito", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 18px;
  line-height: 1.55;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--ink); text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 3px; }

/* state strip: empty in live mode (hidden), one line for test mode / paused */
.sb-announce {
  background: var(--paper-2);
  color: var(--ink);
  text-align: center;
  font-size: 13px;
  line-height: 1.4;
  padding: 7px 12px;
}
.sb-announce:empty { display: none; }

/* header: landing geometry, paper background, no border */
.sb-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 80px;
  padding: 0 max(16px, calc((100% - 1180px) / 2));
  background: var(--paper);
}
.sb-header__actions { display: flex; align-items: center; gap: 18px; margin-left: auto; }
.sb-header__track { font-size: 14px; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
@media (min-width: 701px) { .sb-header { min-height: 100px; padding: 0 32px; } }

/* wordmark (STYLE-GUIDE §3; same rules as landing styles.css .logo) */
.logo { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; color: var(--ink); text-decoration: none; font-family: var(--serif); font-weight: 700; font-size: 26px; line-height: 1; letter-spacing: 0; }
.logo svg { color: var(--rose); flex: 0 0 auto; width: 29px; height: 29px; }
.logo--small { font-size: 23px; gap: 7px; }
.logo--small svg { width: 23px; height: 23px; }
@media (max-width: 700px) { .logo { font-size: 23px; gap: 7px; } .logo svg { width: 23px; height: 23px; } }
@media (max-width: 360px) { .logo svg { display: none; } }

.sb-main { padding: 32px 16px 40px; display: flex; justify-content: center; }
.sb-quiz { width: 100%; max-width: 560px; }

/* screen titles: Fredoka 700, centered */
.sb-step__title {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 34px;
  line-height: 1.15;
  letter-spacing: -0.2px;
  color: var(--ink);
  text-align: center;
  margin: 0 0 10px;
  overflow-wrap: anywhere;
}
.sb-step__subtitle {
  font-family: var(--sans);
  font-weight: 400;
  font-size: 18px;
  line-height: 1.5;
  color: var(--muted);
  text-align: center;
  margin: 0 0 22px;
}
@media (max-width: 700px) {
  .sb-step__title { font-size: 29px; line-height: 1.15; letter-spacing: -0.2px; }
}

.sb-field { margin-bottom: 22px; }
.sb-field__label {
  display: block;
  font-family: var(--sans);
  font-weight: 700;
  font-size: 18px;
  line-height: 1.4;
  color: var(--ink);
  margin: 0 0 8px;
}
.sb-field__count { font-size: 13px; color: var(--muted); text-align: right; margin-top: 4px; }

/* option cards (occasion, recipient) */
.sb-cards { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.sb-card {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 64px;
  padding: 16px 20px;
  background: var(--card);
  color: var(--ink);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  text-align: left;
  font-family: var(--sans);
  font-size: 18px;
  line-height: 1.4;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s, transform .08s;
}
.sb-card:active { transform: scale(.99); }
@media (hover: hover) and (pointer: fine) { .sb-card:hover { border-color: var(--field); } }
.sb-card__radio {
  flex: 0 0 auto;
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 2px solid var(--field);
  background: #fff;
  display: inline-flex; align-items: center; justify-content: center;
}
.sb-card--selected { border: 2px solid var(--accent); background: #fff0ea; }
.sb-card--selected .sb-card__radio { border-color: var(--accent); background: var(--accent); }
.sb-card--selected .sb-card__radio::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #fff; }

/* inputs */
.sb-input, .sb-textarea, .sb-select {
  width: 100%;
  font-family: var(--sans);
  font-size: 18px;
  color: var(--ink);
  background: var(--card);
  border: 2px solid var(--field);
  border-radius: 12px;
  padding: 12px 14px;
  min-height: 56px;
  transition: border-color .15s, box-shadow .15s;
}
.sb-input:focus, .sb-textarea:focus, .sb-select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px rgba(255, 90, 54, .2); }
.sb-textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
.sb-input.sb-invalid, .sb-textarea.sb-invalid { border-color: var(--error); }
.sb-input::placeholder, .sb-textarea::placeholder { color: #8d7d74; }

/* photos */
.sb-thumbs { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.sb-thumbs:empty { display: none; }
.sb-thumb { position: relative; width: 84px; height: 84px; border-radius: 8px; overflow: hidden; background: var(--paper-2); }
.sb-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sb-thumb__remove {
  position: absolute; top: 4px; right: 4px;
  width: 30px; height: 30px; border-radius: 50%;
  background: rgba(48, 35, 33, .72); color: #fff; border: none;
  font-size: 16px; line-height: 1; cursor: pointer;
}

.sb-repeater-add {
  display: block;
  width: 100%;
  min-height: 48px;
  margin: 0 0 16px;
  padding: 12px;
  background: transparent;
  border: 2px dashed var(--field);
  border-radius: var(--radius);
  color: var(--ink);
  font: 700 17px/1.3 var(--sans);
  cursor: pointer;
}
.sb-repeater-add:disabled { opacity: .5; cursor: not-allowed; }

/* consent checkbox */
.sb-consent {
  position: relative;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 16px;
  cursor: pointer;
}
.sb-consent__box {
  flex: 0 0 auto;
  width: 22px; height: 22px;
  border-radius: 5px;
  border: 2px solid var(--field);
  background: #fff;
  display: flex; align-items: center; justify-content: center;
  margin-top: 1px;
}
.sb-consent input[type=checkbox] { position: absolute; opacity: 0; width: 22px; height: 22px; margin: 0; cursor: pointer; }
.sb-consent--checked .sb-consent__box { background: var(--accent); border-color: var(--accent); }
.sb-consent--checked .sb-consent__box::after { content: "\2713"; color: #fff; font-size: 13px; font-weight: 700; }
.sb-consent__text { font-size: 16px; line-height: 1.5; color: var(--ink); }

/* primary button family */
.sb-actions { display: flex; justify-content: center; margin-top: 10px; }
.sb-btn-next {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 56px;
  padding: 14px 28px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font: 700 20px/1.2 var(--sans);
  box-shadow: 0 8px 20px rgba(255, 90, 54, .30);
  cursor: pointer;
  transition: background-color .15s;
}
.sb-btn-next:hover:not(:disabled), .sb-btn-next:active:not(:disabled) { background: var(--accent-hover); }
.sb-btn-next:disabled { background: #eadbd2; color: #5e4f48; box-shadow: none; cursor: not-allowed; }

/* focus */
a:focus-visible, button:focus-visible, select:focus-visible, .sb-card:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
.sb-consent:has(input:focus-visible) .sb-consent__box { outline: 3px solid var(--ink); outline-offset: 3px; }

/* bottom step bar */
.sb-navbar {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--paper-2);
  border-top: 1px solid var(--line);
  padding: 8px 16px calc(8px + env(safe-area-inset-bottom, 0px));
}
.sb-navbar__progress { flex: 1 1 auto; min-width: 0; }
.sb-navbar__text { font-size: 14px; color: var(--muted); margin: 0 0 5px; line-height: 1.3; }
.sb-navbar__track { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.sb-navbar__fill { height: 6px; background: var(--accent); border-radius: 3px; transition: width .3s ease; }
.sb-navbar__buttons { display: flex; gap: 10px; flex: 0 1 auto; min-width: 0; }
.sb-navbtn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 56px; min-width: 56px; padding: 0 18px;
  border-radius: var(--radius);
  border: none;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  transition: background-color .15s;
}
.sb-navbtn svg { display: block; }
.sb-navbtn:hover:not(:disabled) { background: var(--accent-hover); }
.sb-navbtn:disabled { background: #eadbd2; color: #5e4f48; cursor: not-allowed; }
/* Back: a quiet outline square; where Back is not possible it is not shown at all (no faded square) */
#sb-back { width: 56px; padding: 0; background: #fff; color: var(--ink); border: 2px solid var(--field); }
#sb-back:hover:not(:disabled) { background: var(--paper); }
#sb-back:disabled { visibility: hidden; }

/* footer: one line on paper-2 */
.sb-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px 14px;
  background: var(--paper-2);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  padding: 24px 16px;
  text-align: center;
}
.sb-footer__links { display: flex; flex-wrap: wrap; gap: 0 16px; justify-content: center; }
.sb-footer__links a { color: var(--muted); padding: 6px 2px; text-decoration-color: currentColor; }

/* spinner */
.sb-spinner {
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 4px solid var(--line);
  border-top-color: var(--accent);
  margin: 0 auto 16px;
  animation: sb-spin .9s linear infinite;
}
@keyframes sb-spin { to { transform: rotate(360deg); } }

/* 22.10 (UB-PHOTO-SWAP-1022): "Change photo" with the current photo, and the plain style card of a new photo (no preview yet).
   quiz.css loads before storybook.css, so the rules that meet storybook.css's carry one more class. */
.sv-swap { display: flex; flex-direction: column; align-items: center; gap: 2px; margin: 6px auto 0; max-width: 420px; }
.sv-swap .sv-swap__btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; }
.sv-swap.sv-swap--main .sv-swap__btn { width: 100%; }
.sv-swap__thumb { flex: none; width: 36px; height: 36px; border-radius: 8px; object-fit: cover; background: var(--paper-2); box-shadow: 0 0 0 2px #fff, 0 0 0 3px var(--line); }
.sv-swap__thumb--none { display: inline-flex; align-items: center; justify-content: center; }
.sv-swap__thumb--none::before { content: "📷"; font-size: 18px; line-height: 1; }
.sv-swap .sv-swap__note, .sv-swap .sv-swap__consent, .sv-swap .sv-swap__lead { margin: 2px 0 0; text-align: center; }
.sv-swap .sv-swap__consent { font-size: 13px; color: var(--muted); }
.ms-hero__fixes .sv-swap { margin: 0; }
/* 25.10 (mobile check): the stuck style screen and the ms failure put the swap box next to another action; side by side on a
   phone the main button broke in two lines and the other one floated beside its notes. One column instead. */
.sb-actions.sv-actions--swap { flex-direction: column; align-items: center; gap: 8px; }
.sb-actions.sv-actions--swap > .sv-swap { width: 100%; }
.sv-styles .sv-style .sv-style__art--unset { aspect-ratio: 4 / 5; background: var(--paper); border: 1px dashed var(--field); }
.sv-style .sv-style__wait.sv-style__wait--unset { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.sv-style__wait--unset strong { font: 600 16px/1.3 var(--serif, Georgia, serif); color: var(--ink); }

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

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ub-preview-cost-1027: a sample card (UB_STYLE_SAMPLES): our example art, never the customer's child */
.sv-style__example{ position:absolute; top:8px; left:8px; z-index:2; padding:2px 8px; border-radius:999px; background:rgba(255,255,255,.92); color:#3a2a1a; font-size:12px; font-weight:700; letter-spacing:.02em; }
