/*
 * IP Partner Demo - shared stylesheet
 * All colours reference CSS variables set by applyIPBrandTheme() in brands-config.js.
 * Default fallback values match the Storytellrs violet palette.
 */

:root {
  /* Storytellrs by MagicLabs.ai - default brand palette (violet) */
  --primary: #7C3AED;
  --primary-hover: #6D28D9;
  --primary-subtle: rgba(124,58,237,.12);
  --accent: #EC4899;
  --light: #FAFAFF;
  --soft: #EDE9FF;
  --dark: #1E1047;
  --text-muted: #6B5A8A;
  --border: #D4C8F8;
  --font-body: 'Plus Jakarta Sans', system-ui, sans-serif;
  --font-display: 'Plus Jakarta Sans', system-ui, sans-serif;
  --brand-home-hero-bg: none;
  --brand-home-hero-character: none;
  --brand-flow-bg: none;
  --brand-flow-character: none;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font-body);
  background: var(--light);
  color: var(--dark);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  position: relative;
}

/* ── Bluey brand: sky-blue tint + sun glow ── */
body[data-ip-brand="bluey"] {
  background: #EBF7FF;
}
body[data-ip-brand="bluey"]::before {
  content: '';
  position: fixed; inset: 0;
  pointer-events: none; z-index: -1;
  background:
    radial-gradient(circle 380px at 4% 4%, rgba(65,176,228,.16), transparent),
    radial-gradient(circle 300px at 96% 8%, rgba(248,156,49,.13), transparent);
}

/* ── Dora brand: vivid purple tint + sparkle ── */
body[data-ip-brand="dora"] {
  background: #F8EDFF;
}
body[data-ip-brand="dora"]::before {
  content: '';
  position: fixed; inset: 0;
  pointer-events: none; z-index: -1;
  background:
    radial-gradient(circle 380px at 4% 4%, rgba(123,45,142,.20), transparent),
    radial-gradient(circle 300px at 96% 8%, rgba(233,30,140,.16), transparent);
}

/* ── CoComelon brand: watermelon, sunshine and nursery-rhyme softness ── */
body[data-ip-brand="cocomelon"] {
  background:
    radial-gradient(circle 360px at 88% 0%, rgba(244,182,74,.2), transparent 72%),
    linear-gradient(180deg, #BFEAF7 0%, #DDF4F8 50%, #F4FBF9 100%);
}
body[data-ip-brand="cocomelon"]::before {
  content: '';
  position: fixed; inset: 0;
  pointer-events: none; z-index: -1;
  background:
    radial-gradient(circle 160px at 8% 18%, rgba(255,214,122,.24), transparent 70%),
    radial-gradient(circle 260px at 96% 78%, rgba(189,170,222,.22), transparent 72%);
}

/* ── Character peek in flow page header ── */
body[data-ip-brand="bluey"] .brand-logo-wrap,
body[data-ip-brand="dora"] .brand-logo-wrap,
body[data-ip-brand="cocomelon"] .brand-logo-wrap {
  align-items: center;
  justify-content: space-between;
}

body[data-ip-brand="bluey"] .brand-logo-wrap::after,
body[data-ip-brand="dora"] .brand-logo-wrap::after,
body[data-ip-brand="cocomelon"] .brand-logo-wrap::after {
  content: '';
  width: 58px;
  height: 58px;
  background-image: var(--brand-flow-character);
  background-repeat: no-repeat;
  background-position: center bottom;
  background-size: contain;
  filter: drop-shadow(0 4px 10px rgba(0,0,0,.18));
  flex-shrink: 0;
}

body[data-ip-brand="cocomelon"] .brand-logo-wrap::after {
  width: 72px;
  background-position: center;
}

body[data-ip-brand="cocomelon"] .brand-wordmark {
  color: #1F6670;
  font-style: normal;
  letter-spacing: .01em;
  text-shadow: 0 2px 0 rgba(255,255,255,.72);
}

body[data-ip-brand="cocomelon"] .step-eyebrow {
  color: #4C9C6E;
}

body[data-ip-brand="cocomelon"] .step-eyebrow::before {
  background: #F4B64A;
}

body[data-ip-brand="cocomelon"] .btn-continue,
body[data-ip-brand="cocomelon"] .book-nav-btn,
body[data-ip-brand="cocomelon"] .partner-cta-bar .btn-enter-demo {
  border-radius: 999px;
  box-shadow: 0 8px 0 rgba(23,140,69,.18);
}

/* CoComelon /cocomelon flow: match home typing (Baloo + Bubblegum via theme), card surfaces, no decorative emojis */
body[data-ip-brand="cocomelon"] h1,
body[data-ip-brand="cocomelon"] h2,
body[data-ip-brand="cocomelon"] .brand-wordmark,
body[data-ip-brand="cocomelon"] .footer-logo {
  font-family: var(--font-display);
}
body[data-ip-brand="cocomelon"] .page-wrap,
body[data-ip-brand="cocomelon"] .page-wrap--wide {
  background: rgba(255, 255, 255, 0.94);
  border: 1.5px solid rgba(255, 255, 255, 0.85);
  border-radius: 20px;
  box-shadow: 0 20px 50px rgba(31, 102, 112, 0.08);
  margin-left: auto;
  margin-right: auto;
}
body[data-ip-brand="cocomelon"] .progress-wrap {
  padding-top: 1.15rem;
}
body[data-ip-brand="cocomelon"] .brand-emoji-lg,
body[data-ip-brand="cocomelon"] .brand-banner-emoji {
  display: none;
}
body[data-ip-brand="cocomelon"] .upload-icon {
  font-size: 0;
  line-height: 0;
  min-height: 1.5rem;
}
body[data-ip-brand="cocomelon"] .upload-icon::after {
  content: 'Add a photo';
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1.2;
  display: block;
  padding: 0.4rem 0 0.2rem;
  font-family: var(--font-body);
}
body[data-ip-brand="cocomelon"] .btn-demo-photos .btn-demo-photos-ico {
  display: none;
}
body[data-ip-brand="cocomelon"] .brand-banner-emoji {
  display: none;
}
body[data-ip-brand="cocomelon"] .gen-emoji-anim {
  font-size: 0;
  line-height: 0;
  width: 80px;
  height: 80px;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 1.25rem;
  background: center / contain no-repeat;
  background-image: var(--brand-flow-character);
  animation: gentle-bounce 2s ease-in-out infinite;
}
body[data-ip-brand="cocomelon"] .viewer-brand-row [data-brand-emoji] {
  display: none;
}
body[data-ip-brand="cocomelon"] .gen-outer #genIcon {
  font-size: 1.65rem;
  font-weight: 800;
  font-family: var(--font-display);
  line-height: 88px;
}
body[data-ip-brand="cocomelon"] [data-gen-step] {
  font-size: 0.8rem;
  font-weight: 800;
  font-family: var(--font-display);
}
@keyframes gentle-bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

/* ── Progress bar ── */
.progress-wrap {
  padding: 1rem 1.25rem 0;
  max-width: 480px;
  margin: 0 auto;
}
.progress-track {
  height: 4px;
  border-radius: 999px;
  background: var(--soft);
}
.progress-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--primary);
  transition: width .4s ease;
}
.progress-meta {
  display: flex;
  justify-content: space-between;
  font-size: .72rem;
  color: var(--text-muted);
  margin-top: .35rem;
}

/* ── Page wrapper ── */
.page-wrap {
  max-width: 480px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 7rem;
}

/* Wide variant for story selection */
.page-wrap--wide {
  max-width: 860px;
}

/* ── Brand logo / wordmark ── */
.brand-logo-wrap {
  display: flex;
  align-items: center;
  gap: .55rem;
  margin-bottom: 1.5rem;
}
.brand-emoji-lg { font-size: 1.5rem; line-height: 1; }
.brand-wordmark {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 800;
  font-style: italic;
  color: var(--primary);
  letter-spacing: -.02em;
}

/* ── Step header ── */
.step-eyebrow {
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-bottom: .4rem;
}
.step-eyebrow::before {
  content: '';
  display: block;
  width: 18px;
  height: 2px;
  background: var(--accent);
}

h1 {
  font-family: var(--font-display);
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: -.02em;
  line-height: 1.2;
  margin-bottom: .3rem;
}

.step-sub {
  font-size: .88rem;
  color: var(--text-muted);
  margin-bottom: 1.75rem;
  line-height: 1.5;
}

/* ── Form fields ── */
.field { margin-bottom: 1.4rem; }
.field label {
  display: block;
  font-size: .85rem;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: .45rem;
}
.field input,
.field select,
.field textarea {
  width: 100%;
  font-family: var(--font-body);
  font-size: 1rem;
  padding: .85rem 1rem;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  background: #fff;
  color: var(--dark);
  outline: none;
  transition: border-color .2s;
  appearance: none;
}
.field input:focus,
.field select:focus,
.field textarea:focus { border-color: var(--primary); }
.field-hint {
  font-size: .75rem;
  color: var(--text-muted);
  margin-top: .3rem;
  line-height: 1.5;
}
.field-error {
  font-size: .75rem;
  color: #991b1b;
  margin-top: .3rem;
  display: none;
}

/* ── Chip (radio button group) ── */
.chip-group { display: flex; gap: .65rem; flex-wrap: wrap; }
.chip-label { position: relative; cursor: pointer; }
.chip-label input[type="radio"] { position: absolute; opacity: 0; width: 0; height: 0; }
.chip-box {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .6rem 1.15rem;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  background: #fff;
  font-weight: 600;
  font-size: .9rem;
  color: var(--dark);
  transition: border-color .15s, background .15s;
  user-select: none;
  font-family: var(--font-body);
}
.chip-label input:checked + .chip-box {
  border-color: var(--primary);
  background: var(--primary-subtle);
  color: var(--primary);
}
.chip-box:hover { border-color: var(--primary); }

/* ── Colour swatch grid (appearance page) ── */
.color-section { margin-bottom: 1.75rem; }
.color-section-label {
  font-size: .85rem;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: .75rem;
  display: block;
}
.color-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .65rem;
}
.color-option {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  border: 1.5px solid var(--border);
  background: #fff;
  padding: .75rem .5rem;
  text-align: center;
  transition: border-color .2s, box-shadow .2s;
}
.color-option:hover { border-color: var(--primary); }
.color-option.selected {
  border-color: var(--primary);
  background: var(--primary-subtle);
  box-shadow: 0 0 0 2px var(--primary);
}
.color-option input[type="radio"] { position: absolute; opacity: 0; width: 0; height: 0; }
.color-swatch {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  margin: 0 auto .4rem;
  border: 1.5px solid rgba(0,0,0,.1);
}
.color-label-text { font-size: .75rem; font-weight: 600; color: var(--dark); line-height: 1.2; }

/* Hair swatches */
.hair-black { background: #2b2420; }
.hair-brown { background: #73533d; }
.hair-blonde { background: #e6d18f; }
.hair-red { background: #b65a3a; }
.hair-auburn { background: #8b5a2b; }
.hair-sparse { background: repeating-linear-gradient(45deg, #f4f4f4, #f4f4f4 6px, #e9e9e9 6px, #e9e9e9 12px); border: 1.5px dashed #cfcfcf; }
/* Eye swatches */
.eye-brown { background: #6e4b3a; }
.eye-blue { background: #7fb2d9; }
.eye-green { background: #7aa97e; }
.eye-hazel { background: #8a6e3c; }
.eye-dark-brown { background: #4a3628; }
.eye-black { background: #2a2a2a; }

/* ── Hint box ── */
.hint-box {
  background: var(--soft);
  border-radius: 10px;
  padding: .75rem 1rem;
  margin-bottom: 1.75rem;
  font-size: .78rem;
  color: var(--dark);
  line-height: 1.5;
}

/* ── Upload area ── */
.upload-area {
  border: 2px dashed var(--border);
  border-radius: 14px;
  padding: 2rem 1rem;
  background: #fff;
  text-align: center;
  margin-bottom: 1rem;
  transition: border-color .2s, background .2s;
}
.upload-area:hover { border-color: var(--primary); background: var(--soft); }
.upload-icon { font-size: 2.5rem; margin-bottom: .75rem; }
.upload-text { font-size: .88rem; color: var(--text-muted); margin-bottom: 1rem; }

.photo-counter {
  text-align: center;
  font-size: .82rem;
  color: var(--text-muted);
  margin: .75rem 0;
}

/* Error / info messages */
.error-message {
  display: none;
  margin: .75rem 0;
  padding: .75rem 1rem;
  border-radius: 8px;
  font-size: .82rem;
  text-align: center;
}
.error-message.error { background: #fde8e8; color: #991b1b; border: 1px solid #fca5a5; }
.error-message.info { background: #e0f2fe; color: #0c4a6e; border: 1px solid #7dd3fc; }

/* Loading spinner (small) */
.loading-indicator { display: none; align-items: center; justify-content: center; gap: .5rem; margin: .75rem 0; font-size: .82rem; color: var(--text-muted); }
.loading-indicator.visible { display: flex; }
.loading-spinner { width: 16px; height: 16px; border: 2px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin 1s linear infinite; }

/* Upload progress bar */
.upload-progress-container { margin: 1rem 0; display: none; }
.progress-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: .4rem; }
.progress-title { font-size: .8rem; font-weight: 600; color: var(--text-muted); display: flex; align-items: center; gap: .3rem; }
.progress-percentage { font-size: .8rem; font-weight: 700; color: var(--primary); }
.progress-bar-wrapper { height: 4px; background: var(--soft); border-radius: 2px; overflow: hidden; margin-bottom: .4rem; }
.progress-bar { height: 100%; background: var(--primary); border-radius: 2px; width: 0; transition: width .4s ease; }
.progress-details { display: flex; justify-content: space-between; }
.progress-step { display: flex; align-items: center; gap: .3rem; font-size: .72rem; color: var(--text-muted); }
.photo-progress { font-size: .72rem; color: var(--text-muted); }

/* Photo preview grid */
.preview-container { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .75rem; margin: 1rem 0; }
.preview-item { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; box-shadow: 0 2px 8px rgba(0,0,0,.1); }
.preview-item img { width: 100%; height: 100%; object-fit: cover; }
.remove-photo { position: absolute; top: 5px; right: 5px; background: rgba(255,255,255,.9); border: none; border-radius: 50%; width: 24px; height: 24px; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 14px; color: #dc2626; }

/* Uploadcare overrides */
uc-file-uploader-minimal { --uc-primary-color: var(--primary); --uc-border-radius: 8px; --uc-font-family: var(--font-body); }

/* ── Photo confirm grid ── */
.photo-guidelines {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .65rem;
  margin-bottom: 1.5rem;
  padding: .85rem;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
}
.guideline-item { text-align: center; padding: .5rem; }
.guideline-icon { font-size: 1.5rem; margin-bottom: .25rem; }
.guideline-text { font-size: .72rem; color: var(--text-muted); font-weight: 600; line-height: 1.3; }

.photos-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}
@media (max-width: 400px) { .photos-grid { grid-template-columns: repeat(2, 1fr); } }

.photo-card {
  position: relative;
  aspect-ratio: 1;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: all .2s;
  box-shadow: 0 2px 8px rgba(0,0,0,.1);
  border: 2px solid transparent;
}
.photo-card:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(0,0,0,.15); }
.photo-card.selected { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-subtle); }
.photo-card img { width: 100%; height: 100%; object-fit: cover; }
.photo-card .select-badge {
  position: absolute;
  bottom: 6px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,.6);
  color: #fff;
  font-size: .65rem;
  font-weight: 700;
  padding: .2rem .6rem;
  border-radius: 999px;
  white-space: nowrap;
}
.photo-card.selected .select-badge { background: var(--primary); }

/* ── Story cards (story selection) ── */
.story-grid {
  display: grid;
  grid-template-columns: repeat(1, 1fr);
  gap: .85rem;
  margin-bottom: 1.75rem;
}
@media (min-width: 480px) { .story-grid { grid-template-columns: repeat(3, 1fr); } }

.story-card {
  border-radius: 14px;
  overflow: hidden;
  border: 2.5px solid var(--border);
  cursor: pointer;
  background: #fff;
  transition: transform .18s, box-shadow .18s, border-color .18s;
  padding: 1.25rem 1rem 1.1rem;
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: .9rem;
}
@media (min-width: 480px) {
  .story-card { flex-direction: column; align-items: center; text-align: center; padding: 1.5rem 1rem 1.25rem; }
}
.story-card:active { transform: scale(.97); }
@media (hover: hover) {
  .story-card:hover { transform: translateY(-3px); box-shadow: 0 8px 20px rgba(0,0,0,.10); }
}
.story-card.selected {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary), 0 8px 20px var(--primary-subtle);
}
.story-card.selected::after {
  content: '✓';
  position: absolute;
  top: .45rem;
  right: .45rem;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: .75rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3;
  line-height: 22px;
  text-align: center;
}
.story-card { position: relative; }
.story-card-body { flex: 1; min-width: 0; text-align: left; }
@media (min-width: 480px) {
  .story-card .story-card-body { text-align: center; }
}
.story-emoji { font-size: 2.25rem; line-height: 1; margin-bottom: .5rem; flex-shrink: 0; }
.story-title { font-size: .92rem; font-weight: 800; color: var(--dark); margin-bottom: .25rem; line-height: 1.2; font-family: var(--font-body); }
.story-desc { font-size: .75rem; color: var(--text-muted); line-height: 1.4; }

/* ── Avatar choice cards ── */
.avatar-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin: 1.5rem 0 2rem;
}
.avatar-card {
  border: 2.5px solid var(--border);
  border-radius: 14px;
  padding: 1.25rem 1rem;
  text-align: center;
  cursor: pointer;
  transition: all .2s;
  background: #fff;
}
.avatar-card:hover { border-color: var(--primary); transform: translateY(-2px); }
.avatar-card.selected {
  border-color: var(--primary);
  background: var(--primary-subtle);
  box-shadow: 0 0 0 2px var(--primary);
}
.avatar-card img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 10px;
  margin-bottom: .75rem;
}
.avatar-card-label { font-size: .92rem; font-weight: 800; color: var(--dark); margin-bottom: .2rem; }
.avatar-card-sub { font-size: .75rem; color: var(--text-muted); line-height: 1.35; }

/* ── Micro-trust bar ── */
.micro-trust {
  background: var(--soft);
  border-radius: 10px;
  padding: .85rem 1rem;
  margin-bottom: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: .4rem;
}
.micro-trust-row { display: flex; align-items: center; gap: .5rem; font-size: .78rem; color: var(--dark); }

/* ── Loading overlay ── */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(250,245,236,.96);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  flex-direction: column;
  gap: 1.25rem;
  text-align: center;
  padding: 2rem;
}
.loading-overlay.visible { display: flex; }
.loading-spinner-lg {
  width: 52px;
  height: 52px;
  border: 4px solid var(--soft);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .9s linear infinite;
}
.loading-title { font-family: var(--font-display); font-size: 1.35rem; font-weight: 800; color: var(--dark); line-height: 1.25; }
.loading-sub { font-size: .88rem; color: var(--text-muted); max-width: 300px; }

@keyframes spin { to { transform: rotate(360deg); } }

/* ── Book viewer ── */
.book-viewer-wrap {
  background: var(--dark);
  border-radius: 16px;
  overflow: hidden;
  margin-top: 1.25rem;
  box-shadow: 0 12px 40px rgba(0,0,0,.2);
}
.book-page-spread {
  display: flex;
  min-height: 320px;
  background: #fff;
}
.book-page-image {
  flex: 1.2;
  background: #f8f9fa;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.book-page-image img {
  max-width: 100%;
  max-height: 300px;
  border-radius: 6px;
}
.book-page-text {
  flex: 0.8;
  padding: 1.5rem 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}
.book-text-content {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--dark);
}
.book-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: .85rem 1.25rem;
  background: var(--dark);
}
.book-nav-btn {
  background: var(--primary);
  color: #fff;
  border: none;
  padding: .55rem 1.25rem;
  font-size: .92rem;
  font-weight: 700;
  border-radius: 8px;
  cursor: pointer;
  font-family: var(--font-body);
  transition: background .2s;
}
.book-nav-btn:hover:not(:disabled) { background: var(--primary-hover); }
.book-nav-btn:disabled { opacity: .35; cursor: not-allowed; }
.page-indicator { color: #fff; font-size: .9rem; font-weight: 700; }

@media (max-width: 600px) {
  .book-page-spread { flex-direction: column; }
  .book-page-text { padding: 1rem; border-top: 1px solid var(--border); }
  .book-text-content { font-size: .88rem; }
}

/* ── Fixed bottom navigation ── */
.nav-fixed-outer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--light);
  border-top: 1px solid var(--border);
  box-shadow: 0 -4px 16px rgba(45,43,39,.08);
  z-index: 50;
  padding: .85rem 1.25rem calc(.85rem + env(safe-area-inset-bottom));
}
.nav-inner {
  max-width: 480px;
  margin: 0 auto;
  display: flex;
  gap: .75rem;
}
.nav-inner--wide { max-width: 860px; }
.btn-back {
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--text-muted);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: .9rem;
  padding: .75rem 1.1rem;
  border-radius: 10px;
  cursor: pointer;
  transition: border-color .2s, color .2s;
}
.btn-back:hover { border-color: var(--dark); color: var(--dark); }
.btn-continue {
  flex: 1;
  background: var(--primary);
  color: #fff;
  font-family: var(--font-body);
  font-weight: 800;
  font-size: .95rem;
  padding: .75rem;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  transition: background .2s;
}
.btn-continue:hover { background: var(--primary-hover); }
.btn-continue:disabled { background: #ccc; cursor: not-allowed; }

/* ── Partner selection page ── */
.partner-header {
  padding: 2rem 1.25rem 0;
  max-width: 560px;
  margin: 0 auto;
  text-align: center;
}
.partner-header .ll-badge {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  background: var(--soft);
  border-radius: 999px;
  padding: .3rem .85rem;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--primary);
  margin-bottom: 1rem;
}
.partner-header h1 {
  font-family: var(--font-display);
  font-size: clamp(1.65rem, 5vw, 2.2rem);
  font-weight: 800;
  letter-spacing: -.02em;
  line-height: 1.15;
  color: var(--dark);
  margin-bottom: .6rem;
}
.partner-header .sub {
  font-size: .9rem;
  color: var(--text-muted);
  line-height: 1.55;
  max-width: 380px;
  margin: 0 auto 2rem;
}

.brand-select-wrap {
  max-width: 560px;
  margin: 0 auto;
  padding: 0 1.25rem 8rem;
}
.select-label {
  font-size: .8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--text-muted);
  margin-bottom: .85rem;
}
.brand-cards-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: .75rem;
  margin-bottom: 1.5rem;
}
@media (min-width: 480px) { .brand-cards-grid { grid-template-columns: repeat(3, 1fr); } }

.brand-choice-card {
  border: 2.5px solid var(--border);
  border-radius: 14px;
  padding: 1.1rem .85rem;
  text-align: center;
  cursor: pointer;
  background: #fff;
  transition: all .2s;
  user-select: none;
  position: relative;
}
.brand-choice-card:hover { border-color: var(--card-primary); transform: translateY(-2px); box-shadow: 0 6px 18px rgba(0,0,0,.1); }
.brand-choice-card.selected {
  border-color: var(--card-primary);
  box-shadow: 0 0 0 2px var(--card-primary);
  background: var(--card-bg);
}
.brand-choice-card .check-badge {
  display: none;
  position: absolute;
  top: .4rem;
  right: .4rem;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--card-primary);
  color: #fff;
  font-size: .65rem;
  font-weight: 800;
  align-items: center;
  justify-content: center;
  line-height: 20px;
}
.brand-choice-card.selected .check-badge { display: flex; }
.brand-card-emoji { font-size: 2rem; margin-bottom: .45rem; line-height: 1; }
.brand-card-name { font-size: .82rem; font-weight: 800; color: var(--dark); line-height: 1.2; }

/* ── Partner selection CTA bar ── */
.partner-cta-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--light);
  border-top: 1px solid var(--border);
  box-shadow: 0 -4px 16px rgba(45,43,39,.08);
  z-index: 50;
  padding: 1rem 1.25rem calc(1rem + env(safe-area-inset-bottom));
}
.partner-cta-inner {
  max-width: 560px;
  margin: 0 auto;
}
.btn-enter-demo {
  width: 100%;
  background: var(--primary);
  color: #fff;
  font-family: var(--font-body);
  font-weight: 800;
  font-size: 1.05rem;
  padding: .9rem;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  transition: background .2s, transform .15s;
}
.btn-enter-demo:hover { background: var(--primary-hover); transform: translateY(-1px); }
.btn-enter-demo:disabled { background: #ccc; cursor: not-allowed; transform: none; }
.partner-cta-sub {
  text-align: center;
  font-size: .72rem;
  color: var(--text-muted);
  margin-top: .5rem;
}

/* ── Desktop enhancements (1024px+) ── */
@media (min-width: 1024px) {
  .progress-wrap, .page-wrap { max-width: 580px; }
  .page-wrap--wide { max-width: 920px; }
  .nav-inner { max-width: 580px; }
  .nav-inner--wide { max-width: 920px; }
  h1 { font-size: 1.8rem; }
  .step-sub { font-size: .95rem; }
  .field input, .field select { font-size: 1.05rem; padding: .95rem 1.1rem; }
  .book-page-image img { max-height: 420px; }
  .book-text-content { font-size: 1.15rem; }
}
