/* ============================================================
   Postcard — Swipe Card Quiz
   Mobile-first, one card at a time, horizontal swipe
   Inherits theme tokens from theme.css
   ============================================================ */

/* ── Quiz shell ──────────────────────────────────────────── */
.quiz-wrapper {
  min-height: 100vh;
  background: var(--parchment);
  position: relative;
  overflow: hidden;
}

/* ── Swipe track — horizontal scroll, one card visible ────── */
.swipe-track {
  display: flex;
  height: 100vh;
  width: 100%;
  overflow-x: hidden;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
}

/* ── Individual cards ─────────────────────────────────────── */
.swipe-card {
  flex: 0 0 100vw;
  width: 100vw;
  height: 100vh;
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 100px 32px 64px;
  position: relative;
}

/* ── Progress dots ────────────────────────────────────────── */
.progress-dots {
  position: fixed;
  top: 88px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 6px;
  z-index: 10;
}

.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--border);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.dot.done {
  background: var(--terracotta);
  width: 20px;
  border-radius: 3px;
}

.dot.active {
  background: var(--terracotta);
  width: 8px;
  border-radius: 3px;
}

/* ── Card content ──────────────────────────────────────────── */
.card-inner {
  max-width: 480px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.card-eyebrow {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--terracotta);
  margin-bottom: 20px;
}

.card-question {
  font-family: var(--serif);
  font-size: clamp(30px, 5vw, 46px);
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-bottom: 10px;
}

.card-subtitle {
  font-size: 15px;
  color: var(--ink-light);
  margin-bottom: 40px;
  line-height: 1.5;
}

/* ── Option buttons — large touch targets ─────────────────── */
.options-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

.option-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 20px;
  background: var(--parchment);
  border: 1.5px solid var(--border);
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  text-align: left;
  width: 100%;
  min-height: 64px;
  -webkit-tap-highlight-color: transparent;
}

.option-btn:hover {
  border-color: var(--terracotta);
  background: var(--parchment-dark);
  transform: translateX(4px);
}

.option-btn.selected {
  border-color: var(--terracotta);
  background: rgba(192, 94, 47, 0.07);
  transform: translateX(6px);
}

.option-btn.selected .option-btn-icon {
  color: var(--terracotta);
}

.option-btn.selected .option-btn-label {
  color: var(--ink);
  font-weight: 600;
}

.option-btn-icon {
  font-size: 16px;
  color: var(--ink-light);
  transition: color 0.2s;
  flex-shrink: 0;
  width: 20px;
  text-align: center;
}

.option-btn-label {
  font-family: var(--sans);
  font-size: 16px;
  font-weight: 500;
  color: var(--ink-mid);
  transition: color 0.2s;
}

/* ── Multi-select options ──────────────────────────────────── */
.option-btn.multi-selected {
  border-color: var(--terracotta);
  background: rgba(192, 94, 47, 0.07);
}

.option-btn.multi-selected .option-btn-check {
  display: flex;
}

.option-btn-check {
  display: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--terracotta);
  color: var(--parchment);
  font-size: 11px;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-left: auto;
  font-weight: 700;
}

/* ── Card navigation ───────────────────────────────────────── */
.card-actions {
  position: fixed;
  bottom: 48px;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 0 32px;
  z-index: 10;
}

.card-back {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--parchment-dark);
  border: 1.5px solid var(--border);
  color: var(--ink-mid);
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
}

.card-back:hover {
  background: var(--border);
  color: var(--ink);
}

.card-back.hidden { opacity: 0; pointer-events: none; }

.card-next {
  flex: 1;
  max-width: 320px;
  height: 56px;
  border-radius: 100px;
  background: var(--ink);
  color: var(--parchment);
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.02em;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.card-next:disabled {
  background: var(--border);
  color: var(--ink-light);
  cursor: not-allowed;
}

.card-next:not(:disabled):hover {
  background: var(--terracotta);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(192, 94, 47, 0.28);
}

/* ── CTA card (last card) ──────────────────────────────────── */
.cta-email-wrap {
  width: 100%;
  margin-bottom: 16px;
}

.cta-email-input {
  width: 100%;
  height: 52px;
  padding: 0 20px;
  border-radius: 14px;
  border: 1.5px solid var(--border);
  background: var(--parchment);
  font-family: var(--sans);
  font-size: 16px;
  color: var(--ink);
  transition: border-color 0.2s;
  -webkit-appearance: none;
  appearance: none;
}

.cta-email-input::placeholder {
  color: var(--ink-light);
}

.cta-email-input:focus {
  outline: none;
  border-color: var(--terracotta);
}

.cta-email-input.cta-email-error {
  border-color: #c0392b;
  animation: shake 0.4s ease;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

.card-cta-btn {
  width: 100%;
  height: 56px;
  border-radius: 100px;
  background: var(--ink);
  color: var(--parchment);
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.02em;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.card-cta-btn:hover {
  background: var(--terracotta);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(192, 94, 47, 0.28);
}

/* ── Loading / submit state ────────────────────────────────── */
.loading-card {
  display: none;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 100px 32px 64px;
  width: 100%;
}

.loading-card.visible { display: flex; }

.loading-spinner {
  width: 56px;
  height: 56px;
  margin-bottom: 32px;
}

.loading-title {
  font-family: var(--serif);
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 16px;
  letter-spacing: -0.01em;
}

.loading-sub {
  font-size: 15px;
  color: var(--ink-mid);
  line-height: 1.6;
  max-width: 380px;
}

.loading-error {
  display: none;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.loading-error.visible { display: flex; }

.error-title {
  font-family: var(--serif);
  font-size: 28px;
  color: var(--ink);
  margin-bottom: 12px;
}

.error-sub {
  font-size: 15px;
  color: var(--ink-mid);
  margin-bottom: 24px;
}

.retry-btn {
  padding: 12px 28px;
  border-radius: 100px;
  background: var(--ink);
  color: var(--parchment);
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
}

.retry-btn:hover { background: var(--terracotta); }

/* ── Swipe hint ────────────────────────────────────────────── */
.swipe-hint {
  position: fixed;
  bottom: 120px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--ink-light);
  font-family: var(--sans);
  opacity: 0.7;
  transition: opacity 0.4s;
  pointer-events: none;
}

.swipe-hint.hidden { opacity: 0; }

/* ── Keyboard navigation override ──────────────────────────── */
.swipe-track:focus { outline: none; }

/* ── Destination label ──────────────────────────────────────── */
.card-dest-label {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--olive);
  margin-bottom: 8px;
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 600px) {
  .swipe-card {
    padding: 88px 24px 56px;
  }

  .option-btn {
    padding: 16px 16px;
    min-height: 60px;
  }

  .option-btn-label {
    font-size: 15px;
  }

  .progress-dots {
    top: 76px;
  }

  .card-actions {
    bottom: 36px;
    padding: 0 24px;
  }

  .card-next {
    height: 52px;
    font-size: 14px;
  }

  .card-cta-btn {
    height: 52px;
    font-size: 14px;
  }
}

@media (min-width: 900px) {
  .swipe-card {
    padding: 120px 48px 80px;
  }

  .card-inner {
    max-width: 560px;
  }

  .options-list {
    gap: 12px;
  }
}
/* ── Early email capture banner ───────────────────────────── */
.early-email-banner {
  position: fixed;
  bottom: 80px; /* above the action bar */
  left: 50%;
  transform: translateX(-50%) translateY(120px);
  width: calc(100% - 40px);
  max-width: 480px;
  background: #fff;
  border: 1px solid var(--border, #E8E0D5);
  border-radius: 10px;
  padding: 16px 18px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.12);
  z-index: 200;
  opacity: 0;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
  pointer-events: none;
}

.early-email-banner.visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.early-email-label {
  margin: 0 0 10px;
  font-family: var(--font-body, Arial, sans-serif);
  font-size: 13px;
  color: var(--ink-mid, #4A3F35);
  line-height: 1.4;
}

.early-email-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.early-email-input {
  flex: 1;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--border, #E8E0D5);
  border-radius: 6px;
  font-size: 14px;
  font-family: var(--font-body, Arial, sans-serif);
  color: var(--ink, #2C2416);
  background: var(--parchment, #F5F0E8);
  outline: none;
  transition: border-color 0.2s;
}

.early-email-input:focus {
  border-color: var(--terracotta, #C05E2F);
}

.early-email-dismiss {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--ink-light, #9A8A78);
  font-size: 16px;
  padding: 4px 6px;
  line-height: 1;
  flex-shrink: 0;
}

.early-email-dismiss:hover {
  color: var(--ink, #2C2416);
}
