/* ================================================================
   SOULMATES — GIFT CREATOR WIZARD
   style.css
   Design: mobile-first, dark theme, Spotify-inspired preview
================================================================ */

/* ── Reset & variáveis ──────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --pink:       #ff6dba;
  --pink-light: #ff9fd4;
  --pink-glow:  rgba(255, 109, 186, 0.25);
  --dark:       #0e1117;
  --dark-2:     #161b24;
  --dark-3:     #1e2534;
  --dark-4:     #262d3d;
  --border:     rgba(255,255,255,0.08);
  --text:       #f0f0f0;
  --text-muted: #8892a4;
  --success:    #4ade80;
  --font:       'Sora', sans-serif;
  --font-serif: 'Cormorant Garamond', serif;
  --radius:     14px;
  --radius-sm:  8px;
  --transition: 0.25s ease;
}

html { font-size: 16px; scroll-behavior: smooth; height: 100%; }

body {
  font-family: var(--font);
  background: var(--dark-2);
  color: var(--text);
  height: 100%;
  min-height: 100%;
  overflow-x: hidden;
  animation: pageFadeIn 0.45s ease forwards;
}

@keyframes pageFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.hidden { display: none !important; }

/* ── Layout principal ────────────────────────────────────────── */
.app-wrapper {
  display: flex;
  height: 100vh;
  height: 100dvh;     /* adapta ao viewport real em iOS/Chrome mobile */
  overflow: hidden;   /* impede scroll na página inteira */
  background: var(--dark-2);
}

/* ── Painel de etapas (esquerdo) ────────────────────────────── */
.steps-panel {
  flex: 1;
  min-width: 0;       /* evita overflow horizontal em flex */
  display: flex;
  flex-direction: column;
  background: var(--dark-2);
  /* altura vem do pai (100vh via flex stretch) */
}

/* ── Cabeçalho / barra de progresso ────────────────────────── */
.progress-header {
  flex-shrink: 0;     /* altura fixa no topo */
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 24px;
  background: var(--dark-2);
  z-index: 10;
}

.back-home {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 13px;
  white-space: nowrap;
  transition: color var(--transition);
}
.back-home:hover { color: var(--pink); }

.progress-track {
  flex: 1;
  height: 6px;
  background: var(--dark-4);
  border-radius: 99px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--pink), var(--pink-light));
  border-radius: 99px;
  transition: width 0.4s ease;
}

.step-label {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  min-width: 36px;
  text-align: right;
}

/* ── Container de etapas ────────────────────────────────────── */
.steps-container {
  flex: 1;
  min-height: 0;      /* ← ESSENCIAL: sem isso o flexbox ignora overflow-y */
  overflow-y: auto;
  width: 100%;        /* cobre toda a largura do painel — scroll funciona em qualquer ponto */

  /* Scrollbar invisível — scroll continua funcional */
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.steps-container::-webkit-scrollbar { display: none; }

/* Centra o conteúdo sem limitar a área clicável do scroll */
.steps-inner {
  padding: 32px 24px;
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
}

/* ── Etapa individual ───────────────────────────────────────── */
.step {
  display: none;
  animation: stepIn 0.35s ease forwards;
}
.step.active { display: block; }

@keyframes stepIn {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

.step-header { margin-bottom: 28px; }

.step-num {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 2px;
  color: var(--pink);
  margin-bottom: 8px;
  text-transform: uppercase;
}

.step-title {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 6px;
}

.step-sub {
  font-size: 14px;
  color: var(--text-muted);
}

/* ── Etapa 1: Opções de presente ────────────────────────────── */
.gift-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.gift-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 28px 20px;
  background: var(--dark-3);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition), transform var(--transition);
  color: var(--text);
  font-family: var(--font);
}

.gift-card:hover {
  border-color: var(--pink-light);
  background: var(--dark-4);
  transform: translateY(-2px);
}

.gift-card.selected {
  border-color: var(--pink);
  background: rgba(255,109,186,0.1);
  box-shadow: 0 0 0 3px var(--pink-glow);
}

.gift-emoji { font-size: 36px; line-height: 1; }

.gift-card strong { font-size: 14px; font-weight: 600; }
.gift-card small  { font-size: 12px; color: var(--text-muted); }

/* ── Etapa 2: Templates ─────────────────────────────────────── */
.template-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.template-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 16px;
  background:
    radial-gradient(circle at top right, rgba(255, 109, 186, 0.08), transparent 38%),
    var(--dark-3);
  border: 1.5px solid var(--border);
  border-radius: 18px;
  color: var(--text);
  font-family: var(--font);
  text-align: left;
  cursor: pointer;
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition), background var(--transition);
}

.template-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 159, 212, 0.5);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.22);
}

.template-card.selected {
  border-color: var(--pink);
  box-shadow: 0 0 0 3px var(--pink-glow);
  background:
    radial-gradient(circle at top right, rgba(255, 109, 186, 0.14), transparent 38%),
    rgba(255, 109, 186, 0.08);
}

.template-card-preview {
  position: relative;
  aspect-ratio: 5 / 6;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.08);
  background: var(--dark);
}

.template-card-copy {
  display: grid;
  gap: 6px;
}

.template-card-copy strong {
  font-size: 15px;
  font-weight: 700;
}

.template-card-copy small {
  font-size: 12px;
  line-height: 1.55;
  color: var(--text-muted);
}

.template-card-preview-stories {
  background:
    radial-gradient(circle at top, rgba(255, 143, 156, 0.2), transparent 40%),
    linear-gradient(180deg, #181015 0%, #0d0a0d 100%);
  padding: 10px;
}

.template-stories-bars {
  display: flex;
  gap: 4px;
}

.template-stories-bars span {
  flex: 1;
  height: 3px;
  border-radius: 999px;
  background: rgba(255,255,255,0.22);
}

.template-stories-bars span:first-child {
  background: rgba(255,255,255,0.92);
}

.template-stories-shot {
  position: absolute;
  inset: 30px 12px 12px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 10px;
  border-radius: 14px;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(13, 10, 13, 0.08), rgba(13, 10, 13, 0.86));
}

.template-stories-photo {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(8, 6, 8, 0.08), rgba(8, 6, 8, 0.78)),
    url('../assets/images/portrait-beautiful-couple-standing-embracing-one-another-while-dreamily-looking-camera-park.jpg');
  background-size: cover;
  background-position: center;
}

.template-stories-copy {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 4px;
  padding: 14px;
}

.template-stories-copy strong {
  font-family: var(--font-serif);
  font-size: 24px;
  line-height: 0.92;
}

.template-stories-copy small {
  font-size: 11px;
  color: rgba(255,255,255,0.72);
}

.template-card-preview-spotify {
  padding: 14px;
  background:
    radial-gradient(circle at top right, rgba(255, 109, 186, 0.16), transparent 42%),
    linear-gradient(180deg, #202738 0%, #141922 100%);
}

.template-spotify-album {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(255, 109, 186, 0.22), rgba(32, 39, 56, 0.12)),
    url('../assets/images/portrait-beautiful-couple-standing-embracing-one-another-while-dreamily-looking-camera-park.jpg');
  background-size: cover;
  background-position: center;
  box-shadow: 0 16px 28px rgba(0, 0, 0, 0.25);
}

.template-spotify-bars {
  height: 4px;
  margin-top: 14px;
  border-radius: 999px;
  background: rgba(255,255,255,0.12);
  overflow: hidden;
}

.template-spotify-bars span {
  display: block;
  width: 44%;
  height: 100%;
  background: var(--pink-light);
}

.template-spotify-copy {
  margin-top: 14px;
  display: grid;
  gap: 4px;
}

.template-spotify-copy strong {
  font-size: 18px;
  font-weight: 700;
}

.template-spotify-copy small {
  font-size: 11px;
  color: rgba(255,255,255,0.68);
}

/* ── Grupos de formulário ───────────────────────────────────── */
.form-group {
  margin-bottom: 20px;
  position: relative;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 14px 16px;
  background: var(--dark-3);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  -webkit-appearance: none;
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--pink);
  box-shadow: 0 0 0 3px var(--pink-glow);
}

.form-group input::placeholder,
.form-group textarea::placeholder { color: var(--text-muted); }

/* data input */
.form-group input[type="date"] { color-scheme: dark; }

.form-group textarea {
  resize: vertical;
  min-height: 120px;
}

.char-hint {
  display: block;
  text-align: right;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ── Autocomplete ───────────────────────────────────────────── */
.autocomplete-wrap { position: relative; }

.autocomplete-list {
  position: absolute;
  top: calc(100% + 2px);
  left: 0;
  right: 0;
  background: var(--dark-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  z-index: 100;
  max-height: 180px;
  overflow-y: auto;
  list-style: none;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}

.autocomplete-list li {
  padding: 11px 16px;
  cursor: pointer;
  font-size: 14px;
  transition: background var(--transition);
}

.autocomplete-list li:hover,
.autocomplete-list li.highlighted {
  background: var(--dark-3);
  color: var(--pink-light);
}

/* ── Sugestões de música (etapa 5) ──────────────────────────── */
.music-list li { padding: 0; }

.music-suggestion-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  cursor: pointer;
  transition: background var(--transition);
}
.music-suggestion-item:hover,
.music-list li.highlighted .music-suggestion-item {
  background: var(--dark-3);
}

.suggestion-art {
  width: 40px;
  height: 40px;
  border-radius: 4px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--dark-3);
}

.suggestion-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.suggestion-track {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.suggestion-artist {
  font-size: 12px;
  color: var(--text-muted, #8892a4);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Etapa 9: Cápsulas ─────────────────────────────────────── */
.capsulas-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.capsula-field {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,109,186,0.15);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color var(--transition);
}
.capsula-field:focus-within {
  border-color: rgba(255,109,186,0.4);
  background: rgba(255,109,186,0.04);
}

.capsula-field-head {
  display: flex;
  align-items: center;
  gap: 12px;
}
.capsula-field-emoji {
  font-size: 22px;
  line-height: 1;
  flex-shrink: 0;
}
.capsula-field-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.capsula-field-head small {
  font-size: 11px;
  color: var(--text-muted);
}

.capsula-field textarea {
  width: 100%;
  background: transparent;
  border: none;
  border-top: 1px solid rgba(255,255,255,0.06);
  color: var(--text);
  font-family: var(--font);
  font-size: 13px;
  line-height: 1.6;
  resize: none;
  outline: none;
  padding-top: 10px;
}
.capsula-field textarea::placeholder {
  color: var(--text-muted);
  opacity: 0.6;
}

/* ── music-moment (mantido abaixo) ── */
.music-moment-picker {
  margin-top: 14px;
  padding: 20px;
  border: 1px solid rgba(255, 109, 186, 0.18);
  border-radius: var(--radius);
  background:
    radial-gradient(ellipse at top right, rgba(255, 109, 186, 0.14), transparent 50%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.025), rgba(255, 255, 255, 0.008));
  transition: opacity var(--transition), border-color var(--transition);
}

.music-moment-picker:not(.is-disabled) {
  border-color: rgba(255, 109, 186, 0.28);
}

.music-moment-picker.is-disabled {
  opacity: 0.45;
  pointer-events: none;
}

.music-moment-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.music-moment-copy {
  min-width: 0;
}

.music-moment-kicker {
  display: block;
  margin-bottom: 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--pink-light);
}

.music-moment-title {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.music-moment-sub {
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-muted);
}

.music-moment-preview-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.03);
  color: var(--text);
  font-family: var(--font);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition);
}

.music-moment-preview-btn:hover:not(:disabled) {
  border-color: rgba(255, 109, 186, 0.42);
  color: var(--pink-light);
  background: rgba(255, 109, 186, 0.08);
}

.music-moment-preview-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.music-moment-preview-btn.playing {
  background: rgba(255, 109, 186, 0.16);
  border-color: rgba(255, 109, 186, 0.4);
  color: var(--pink-light);
}

.music-moment-track-shell {
  position: relative;
  margin-top: 16px;
  height: 56px;
  border-radius: 18px;
  overflow: hidden;
  background: var(--dark-3);
  border: 1px solid rgba(255,255,255,0.05);
  touch-action: none; /* previne scroll iOS enquanto arrasta dentro da trilha */
}

.music-moment-wave {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 0 6px;
  overflow: hidden;
}

.music-moment-wave-bar {
  flex: 1;
  min-width: 2px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
}

.music-moment-selection {
  position: absolute;
  top: 5px;
  bottom: 5px;
  left: 0;
  right: 0;
  border-radius: 12px;
  border: 1px solid rgba(255, 109, 186, 0.4);
  background: linear-gradient(135deg, rgba(255, 109, 186, 0.26), rgba(255, 159, 212, 0.09));
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.07), 0 6px 18px rgba(255, 109, 186, 0.16);
  cursor: grab;
  user-select: none;
  touch-action: none;
}

.music-moment-picker.is-dragging .music-moment-selection {
  cursor: grabbing;
}

.music-moment-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 28px;
  cursor: ew-resize;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: none;
}

.music-moment-handle--start {
  left: -6px;
}

.music-moment-handle--end {
  right: -6px;
}

.music-moment-handle::before {
  content: '';
  width: 3px;
  height: 46%;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.75);
  box-shadow: 0 0 6px rgba(255, 109, 186, 0.5);
  flex-shrink: 0;
}

.music-moment-handle-label {
  position: absolute;
  bottom: 5px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font);
  font-size: 9px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.9);
  white-space: nowrap;
  pointer-events: none;
  user-select: none;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
  letter-spacing: 0.02em;
}

.music-moment-handle--end .music-moment-handle-label {
  left: auto;
  right: 50%;
  transform: translateX(50%);
}

.music-moment-scale {
  display: flex;
  justify-content: space-between;
  margin-top: 5px;
  padding: 0 2px;
  font-size: 10px;
  color: var(--text-muted);
  opacity: 0.65;
}

.music-moment-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  font-size: 11px;
  color: var(--text-muted);
}

.music-moment-meta #musicMomentValue {
  font-weight: 600;
  color: var(--pink-light);
}

/* ── Contador em tempo real ─────────────────────────────────── */
.counter-box {
  background: var(--dark-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-top: 8px;
  text-align: center;
}

.counter-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--pink);
  margin-bottom: 14px;
}

.counter-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
}

.counter-unit {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.counter-unit span {
  font-size: 22px;
  font-weight: 700;
  color: var(--pink-light);
  line-height: 1;
  min-width: 36px;
  text-align: center;
}

.counter-unit small {
  font-size: 9px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ── Botão aleatório ────────────────────────────────────────── */
.btn-random {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  background: var(--dark-4);
  border: 1.5px dashed var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-family: var(--font);
  font-size: 14px;
  cursor: pointer;
  transition: all var(--transition);
  width: 100%;
  justify-content: center;
}
.btn-random:hover {
  border-color: var(--pink);
  color: var(--pink-light);
  background: rgba(255,109,186,0.06);
}

/* ── YouTube ────────────────────────────────────────────────── */
.input-row {
  display: flex;
  gap: 8px;
}

.input-row input { flex: 1; }

.btn-load {
  padding: 0 18px;
  background: var(--pink);
  border: none;
  border-radius: var(--radius-sm);
  color: #fff;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity var(--transition), transform var(--transition);
}
.btn-load:hover { opacity: 0.85; transform: scale(0.98); }

.yt-embed-wrap {
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-bottom: 16px;
  border: 1px solid var(--border);
}

/* ── Upload de fotos ────────────────────────────────────────── */
.upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 32px 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
  background: var(--dark-3);
  position: relative;
}

.upload-zone:hover,
.upload-zone.drag-over {
  border-color: var(--pink);
  background: rgba(255,109,186,0.05);
}

.upload-zone.single { padding: 24px; }

.upload-icon-wrap { pointer-events: none; }
.upload-icon { font-size: 40px; display: block; margin-bottom: 10px; }
.upload-icon-wrap p { font-size: 14px; color: var(--text); margin-bottom: 4px; }
.upload-icon-wrap small { font-size: 12px; color: var(--text-muted); }

/* Grade de fotos */
.photos-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 16px;
}

.photo-thumb {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--dark-4);
}

.photo-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.photo-thumb .btn-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(0,0,0,0.7);
  border: none;
  color: #fff;
  font-size: 11px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition);
}
.photo-thumb .btn-remove:hover { background: #e33; }

.photo-thumb-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.photo-thumb-wrap .photo-thumb {
  aspect-ratio: 1;
}
.photo-caption-input {
  width: 100%;
  padding: 7px 10px;
  background: var(--dark-4, rgba(255,255,255,0.04));
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 6px;
  color: var(--text, #fff);
  font-family: inherit;
  font-size: 11px;
  font-weight: 400;
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.2s, background 0.2s;
}
.photo-caption-input::placeholder {
  color: rgba(255,255,255,0.45);
}
.photo-caption-input:focus {
  border-color: rgba(255,109,186,0.7);
  background: rgba(255,109,186,0.05);
}

.photos-count {
  font-size: 12px;
  color: var(--text-muted);
  text-align: right;
  margin-top: 8px;
}

/* Upload único (etapa 8) */
.extra-preview {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 1;
  max-width: 280px;
  margin: 0 auto;
}
.extra-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.btn-remove-extra {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(0,0,0,0.7);
  border: none;
  color: #fff;
  font-size: 13px;
  cursor: pointer;
  transition: background var(--transition);
}
.btn-remove-extra:hover { background: #e33; }

/* ── Tela de boas-vindas (step 1) ──────────────────────────── */
.step-welcome {
  text-align: center;
  padding: 16px 0 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.step-welcome-icon {
  font-size: 64px;
  line-height: 1;
  animation: heroFloat 4s ease-in-out infinite;
  filter: drop-shadow(0 0 24px rgba(255, 109, 186, 0.4));
}

.step-welcome-title {
  font-size: 24px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--text);
}

.step-welcome-sub {
  font-size: 15px;
  color: var(--text-muted);
  line-height: 1.65;
  max-width: 320px;
}

.btn-welcome-start {
  background: var(--pink);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  padding: 16px 40px;
  font-family: var(--font);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 8px;
  transition: opacity var(--transition), transform var(--transition),
              box-shadow var(--transition);
  box-shadow: 0 4px 20px rgba(255, 109, 186, 0.35);
}

.btn-welcome-start:hover {
  opacity: 0.9;
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(255, 109, 186, 0.45);
}

/* ── Ícone ilustrativo por etapa ───────────────────────────── */
.step-hero {
  text-align: center;
  margin-bottom: 24px;
}

.step-hero-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  font-size: 34px;
  background: radial-gradient(circle, rgba(255,109,186,0.16) 0%, rgba(255,109,186,0.03) 70%);
  border: 1px solid rgba(255,109,186,0.18);
  box-shadow: 0 0 32px rgba(255,109,186,0.1);
  animation: heroFloat 4s ease-in-out infinite;
}

@keyframes heroFloat {
  0%, 100% { transform: translateY(0px); }
  50%       { transform: translateY(-7px); }
}

/* ── Card de contexto por etapa ─────────────────────────────── */
.step-tip {
  margin-top: 28px;
  padding: 13px 16px;
  border-radius: 12px;
  background: rgba(255, 109, 186, 0.05);
  border: 1px solid rgba(255, 109, 186, 0.13);
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.step-tip-icon {
  font-size: 15px;
  flex-shrink: 0;
  margin-top: 1px;
  opacity: 0.85;
}

.step-tip-text {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.55;
}

.step-tip-text strong {
  color: var(--pink-light);
  font-weight: 600;
}

/* ── Etapa final ────────────────────────────────────────────── */
.step-final {
  padding-bottom: 40px;
}

.final-top {
  text-align: center;
  margin-bottom: 32px;
}

.final-emoji {
  font-size: 52px;
  margin-bottom: 12px;
  animation: bounce 0.6s ease;
}

@keyframes bounce {
  0%,100% { transform: translateY(0); }
  50%      { transform: translateY(-12px); }
}

.final-top h2 {
  font-size: 26px;
  font-weight: 700;
  margin-bottom: 10px;
}

.final-top p {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.6;
}

.btn-preview-gift {
  margin-top: 16px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  background: transparent;
  border: 1px solid rgba(255,109,186,0.35);
  border-radius: 999px;
  color: var(--pink);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition);
}
.btn-preview-gift:hover {
  background: rgba(255,109,186,0.08);
  border-color: var(--pink);
}

/* Planos */
.plans-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 20px;
}

.plan-card {
  background: var(--dark-3);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 16px;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: border-color var(--transition);
}

.plan-card.featured {
  border-color: var(--pink);
  background: rgba(255,109,186,0.07);
}

.plan-badge {
  position: absolute;
  top: -11px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--pink);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 99px;
  white-space: nowrap;
}

.plan-card h3 {
  font-size: 15px;
  font-weight: 700;
  text-align: center;
  margin-top: 4px;
}

.plan-price {
  font-size: 30px;
  font-weight: 700;
  text-align: center;
  color: var(--pink-light);
}

.plan-price span {
  font-size: 16px;
}

.plan-features {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.plan-features li {
  font-size: 12px;
  color: var(--text-muted);
}

.btn-plan {
  padding: 12px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: transparent;
  color: var(--text);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  margin-top: auto;
}

.btn-plan.primary {
  background: var(--pink);
  border-color: var(--pink);
  color: #fff;
}

.btn-plan:hover { opacity: 0.85; transform: scale(0.98); }

/* Upgrade banner */
.upgrade-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--dark-4);
  border: 1.5px dashed var(--pink);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 28px;
}

.upgrade-info strong { font-size: 14px; display: block; margin-bottom: 2px; }
.upgrade-info small  { font-size: 12px; color: var(--text-muted); }

.upgrade-action {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.upgrade-price {
  font-size: 14px;
  font-weight: 700;
  color: var(--pink-light);
}

.btn-upgrade {
  padding: 8px 14px;
  background: var(--pink);
  border: none;
  border-radius: var(--radius-sm);
  color: #fff;
  font-family: var(--font);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity var(--transition);
}
.btn-upgrade:hover { opacity: 0.85; }
.btn-upgrade.added { background: var(--success); }

/* FAQ */
.faq-section h3 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 12px;
}

.faq-list { display: flex; flex-direction: column; gap: 8px; }

.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.faq-question {
  width: 100%;
  text-align: left;
  padding: 14px 16px;
  background: var(--dark-3);
  border: none;
  color: var(--text);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.faq-question::after {
  content: '+';
  font-size: 18px;
  color: var(--pink);
  flex-shrink: 0;
  transition: transform var(--transition);
}

.faq-item.open .faq-question::after { transform: rotate(45deg); }

.faq-answer {
  max-height: 0;
  overflow: hidden;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
  background: var(--dark-3);
  transition: max-height 0.3s ease, padding 0.3s ease;
  padding: 0 16px;
}

.faq-item.open .faq-answer {
  max-height: 200px;
  padding: 0 16px 14px;
}

/* ── Nav footer ─────────────────────────────────────────────── */
.nav-footer {
  flex-shrink: 0;     /* altura fixa na base */
  display: flex;
  justify-content: center;
  padding: 16px 0;
  background: var(--dark-2);
  z-index: 10;
}

.nav-footer-inner {
  display: flex;
  gap: 12px;
  width: 100%;
  max-width: 640px;
  padding: 0 24px;
}

.btn-back-step {
  padding: 14px 20px;
  background: transparent;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}
.btn-back-step:hover { border-color: var(--text-muted); color: var(--text); }
/* botão voltar nunca fica desativado — JS trata o step 1 com toast */

.btn-next-step {
  flex: 1;
  padding: 14px 20px;
  background: var(--pink);
  border: none;
  border-radius: var(--radius-sm);
  color: #fff;
  font-family: var(--font);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity var(--transition), transform var(--transition);
}
.btn-next-step:hover { opacity: 0.88; transform: scale(0.99); }
.btn-next-step:disabled { opacity: 0.4; cursor: not-allowed; }

/* Oculta nav footer na etapa final */
/* .hidden-final não é mais usado — JS controla visibilidade do btnNext */

/* ══════════════════════════════════════════════════════════════
   PAINEL DE PREVIEW (direito)
══════════════════════════════════════════════════════════════ */
.preview-panel {
  width: 320px;
  flex-shrink: 0;
  background: var(--dark-2);
  display: flex;
  flex-direction: column;
  align-items: flex-end;   /* mockup alinhado à direita */
  padding: 24px 16px 24px 4px;
  overflow: hidden;  /* painel não scrolla — scroll fica dentro do phone-screen */
}

.preview-header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-bottom: 24px;
}

.preview-header-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.preview-badge {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--pink);
  font-weight: 600;
}

.preview-template-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}

/* Botão "Ver preview" visível só no mobile */
.btn-toggle-preview {
  display: none;
  padding: 6px 14px;
  background: var(--pink);
  border: none;
  border-radius: 99px;
  color: #fff;
  font-family: var(--font);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

/* ── Barra de status do celular ─────────────────────────────── */
.phone-status-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 14px 0;
  color: var(--text);
}

.status-time {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.3px;
}

.status-icons {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--text);
}

.status-icon { display: block; }

/* ── Mockup do celular ──────────────────────────────────────── */
.phone-mockup { width: 100%; max-width: 280px; }

.phone-frame {
  background: var(--dark-2);
  border: 2px solid var(--dark-4);
  border-radius: 36px;
  padding: 16px 10px;
  box-shadow:
    0 0 0 6px var(--dark-3),
    0 24px 60px rgba(0,0,0,0.5);
  position: relative;
}

.phone-notch {
  width: 80px;
  height: 10px;
  background: var(--dark-4);
  border-radius: 99px;
  margin: 0 auto 12px;
}

/* ── Browser chrome: barra de endereço ─────────────────────── */
.phone-browser-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 8px;
  padding: 4px 8px;
  margin: 6px 2px 0;
}

.browser-bar-url {
  flex: 1;
  font-size: 9px;
  text-align: center;
  color: rgba(255,255,255,0.65);
  letter-spacing: 0.2px;
  font-family: var(--font-ui);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.browser-bar-icon {
  color: rgba(255,255,255,0.4);
  flex-shrink: 0;
}

.browser-bar-reload { color: rgba(255,255,255,0.3); }

/* ── Browser chrome: barra de navegação inferior ────────────── */
.phone-browser-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 14px 2px;
  margin-top: 4px;
}

.phone-browser-nav svg {
  color: rgba(255,255,255,0.55);
  display: block;
}

.phone-screen {
  background: var(--dark-3);
  border-radius: 24px;
  overflow-y: auto;   /* scroll interno — simula o presente sendo rolado */
  overflow-x: hidden;
  /* altura dinâmica: sempre cabe no viewport sem precisar scrolar o painel */
  max-height: calc(100vh - 248px);
  position: relative;

  /* Scrollbar mínima dentro do mockup */
  scrollbar-width: thin;
  scrollbar-color: rgba(255,109,186,0.35) transparent;
}
.phone-screen::-webkit-scrollbar { width: 2px; }
.phone-screen::-webkit-scrollbar-track { background: transparent; }
.phone-screen::-webkit-scrollbar-thumb {
  background: rgba(255,109,186,0.35);
  border-radius: 99px;
}

.preview-template-view.hidden {
  display: none !important;
}

.preview-template-stories {
  position: relative;
  height: 100%;
  min-height: min(560px, calc(100vh - 248px));
}

.phone-mockup[data-template="stories"] .preview-chrome-spotify {
  display: none;
}

.phone-mockup[data-template="stories"] .phone-frame {
  padding: 10px;
}

.phone-mockup[data-template="stories"] .phone-screen {
  background: linear-gradient(180deg, #160f13 0%, #0f0b0d 100%);
  overflow: hidden;
  height: min(560px, calc(100vh - 248px));
  max-height: calc(100vh - 180px);
}

.stories-preview-cover,
.stories-preview-player {
  position: absolute;
  inset: 0;
}

.stories-preview-cover-media {
  position: absolute;
  overflow: hidden;
  inset: 0;
  background: linear-gradient(180deg, #5c424b 0%, #171014 100%);
}

.stories-preview-cover-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transform: scale(1.04);
}

.stories-preview-cover-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at top, rgba(255, 143, 156, 0.22), transparent 36%),
    linear-gradient(180deg, #412932 0%, #171014 100%);
  color: rgba(255, 248, 242, 0.9);
  font-size: 42px;
  font-weight: 700;
}

.stories-preview-cover-overlay {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at center, rgba(8, 6, 8, 0.28) 0%, rgba(8, 6, 8, 0.72) 48%, rgba(8, 6, 8, 0.94) 100%),
    linear-gradient(180deg, rgba(7, 5, 6, 0.7), rgba(7, 5, 6, 0.82));
}

.stories-preview-cover-content {
  position: relative;
  z-index: 1;
  height: 100%;
  padding: 34px 22px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.stories-preview-cover-header {
  width: min(100%, 220px);
  display: grid;
  gap: 14px;
}

.stories-preview-cover-title {
  margin: 0;
  font-size: clamp(1.92rem, 3.5vw, 2.35rem);
  line-height: 0.96;
  letter-spacing: -0.05em;
  color: #fff;
  text-wrap: balance;
}

.stories-preview-cover-copy {
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
  color: rgba(255, 245, 238, 0.82);
}

.stories-preview-cover-cta {
  margin-top: 24px;
}

.stories-preview-cover-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-width: 170px;
  min-height: 48px;
  padding: 0 24px;
  border: 0;
  border-radius: 18px;
  background: linear-gradient(135deg, #ff4f79, #ff6a93);
  box-shadow: 0 16px 32px rgba(255, 94, 147, 0.24);
  color: #fff;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.stories-preview-cover-button-icon {
  width: 0;
  height: 0;
  border-top: 7px solid transparent;
  border-bottom: 7px solid transparent;
  border-left: 11px solid currentColor;
}

.stories-preview-player {
  background:
    radial-gradient(circle at top, rgba(255, 143, 156, 0.12), transparent 34%),
    linear-gradient(180deg, #181014 0%, #100c0f 100%);
}

.stories-preview-topbar {
  position: absolute;
  top: 14px;
  left: 12px;
  right: 12px;
  z-index: 5;
}

.stories-preview-progress {
  display: flex;
  gap: 4px;
}

.stories-preview-progress-segment {
  flex: 1;
  height: 3px;
  border-radius: 999px;
  background: rgba(255,255,255,0.18);
  overflow: hidden;
}

.stories-preview-progress-fill {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: rgba(255,255,255,0.92);
}

.stories-preview-pause-indicator {
  position: absolute;
  top: 24px;
  right: 16px;
  z-index: 5;
  width: 14px;
  height: 14px;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.stories-preview-pause-indicator::before,
.stories-preview-pause-indicator::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: 4px;
  border-radius: 999px;
  background: rgba(255,255,255,0.88);
}

.stories-preview-pause-indicator::before {
  left: 1px;
}

.stories-preview-pause-indicator::after {
  right: 1px;
}

.stories-preview-pause-indicator.visible {
  opacity: 1;
  transform: translateY(0);
}

.stories-preview-slides {
  position: relative;
  height: 100%;
  overflow: hidden;
}

.stories-preview-zone {
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 4;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.stories-preview-zone-left {
  left: 0;
  width: 31%;
}

.stories-preview-zone-center {
  left: 31%;
  width: 38%;
}

.stories-preview-zone-right {
  right: 0;
  width: 31%;
}

.stories-preview-footer {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 14px;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 10px;
}

.stories-preview-track {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 76%;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(11, 8, 9, 0.46);
  color: rgba(255,255,255,0.72);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stories-preview-replay {
  border: 0;
  padding: 8px 12px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(255, 94, 147, 0.94), rgba(255, 129, 170, 0.94));
  color: #fff;
  font-family: var(--font);
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
}

.stories-preview-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transform: scale(1.015);
  transition: opacity 320ms ease, transform 320ms ease;
}

.stories-preview-slide.active {
  opacity: 1;
  transform: scale(1);
}

.stories-preview-slide-content {
  position: relative;
  z-index: 1;
  height: 100%;
  padding: 74px 16px 76px;
  display: flex;
  flex-direction: column;
}

.stories-preview-label {
  margin: 0 0 8px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--pink-light);
}

.stories-preview-headline {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 28px;
  line-height: 0.94;
  letter-spacing: -0.05em;
  color: rgba(255, 248, 242, 0.98);
}

.stories-preview-copy,
.stories-preview-time-copy {
  margin: 0;
  font-size: 13px;
  line-height: 1.52;
  color: rgba(255, 244, 236, 0.72);
}

.stories-preview-slide-message-opening .stories-preview-slide-content {
  gap: 12px;
  padding-top: 70px;
  justify-content: flex-start;
}

.stories-preview-opening-block {
  display: grid;
  height: 100%;
  min-height: 0;
  gap: 12px;
  grid-template-rows: minmax(150px, 33%) minmax(0, 1fr);
}

.stories-preview-opening-media-frame {
  width: 100%;
  height: 100%;
  padding: 6px;
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.04));
  box-shadow:
    0 18px 36px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.stories-preview-opening-media,
.stories-preview-opening-media-placeholder {
  width: 100%;
  height: 100%;
  border-radius: 18px;
}

.stories-preview-opening-media {
  display: block;
  object-fit: cover;
}

.stories-preview-opening-media-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at top, rgba(255, 143, 156, 0.16), transparent 38%),
    linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.02));
  color: rgba(255,255,255,0.58);
  font-size: 26px;
}

.stories-preview-opening-copy {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
}

.stories-preview-opening-recipient {
  margin: 0;
  font-size: 1.52rem;
  font-weight: 700;
  line-height: 0.96;
  letter-spacing: -0.03em;
  color: rgba(255, 248, 242, 0.98);
}

.stories-preview-opening-quote {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 1.12rem;
  line-height: 1.16;
  letter-spacing: -0.04em;
  color: rgba(255, 248, 242, 0.98);
}

.stories-preview-opening-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: auto;
  padding-top: 6px;
}

.stories-preview-opening-line {
  display: block;
  width: 28px;
  height: 1px;
  background: linear-gradient(90deg, rgba(255, 143, 156, 0.9), rgba(255, 143, 156, 0));
}

.stories-preview-opening-signature,
.stories-preview-signature {
  margin: 0;
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 232, 224, 0.84);
}

.stories-preview-slide-message .stories-preview-slide-content {
  gap: 12px;
  justify-content: flex-start;
}

.stories-preview-slide-message .stories-preview-headline {
  max-width: 6.4ch;
  font-size: 2rem;
}

.stories-preview-card {
  padding: 16px 14px;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.07);
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.14);
}

.stories-preview-quote {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 1.16rem;
  line-height: 1.22;
  color: rgba(255, 248, 242, 0.98);
}

.stories-preview-slide-time .stories-preview-slide-content {
  gap: 14px;
  justify-content: flex-start;
}

.stories-preview-slide-time .stories-preview-headline {
  max-width: 6.8ch;
  font-size: 1.56rem;
}

.stories-preview-time-panel {
  display: grid;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 247, 240, 0.12);
}

.stories-preview-time-date {
  margin: 0;
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 244, 236, 0.62);
}

.stories-preview-time-primary,
.stories-preview-time-secondary {
  display: grid;
  gap: 8px;
}

.stories-preview-time-primary {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.stories-preview-time-secondary {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  padding-top: 10px;
  border-top: 1px solid rgba(255, 247, 240, 0.08);
}

.stories-preview-stat {
  min-width: 0;
}

.stories-preview-stat-value {
  display: block;
  font-family: var(--font-serif);
  font-size: 2rem;
  line-height: 0.9;
  color: rgba(255, 248, 242, 0.98);
}

.stories-preview-stat-label {
  display: block;
  margin-top: 6px;
  font-size: 8px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 244, 236, 0.62);
}

.stories-preview-time-secondary .stories-preview-stat-value {
  font-size: 1rem;
  line-height: 1;
}

.stories-preview-slide-gallery .stories-preview-slide-content {
  gap: 12px;
  justify-content: flex-start;
}

.stories-preview-slide-gallery .stories-preview-headline {
  max-width: 5.8ch;
  font-size: 1.62rem;
}

.stories-preview-gallery-stack {
  position: relative;
  width: min(100%, 212px);
  aspect-ratio: 4 / 5;
  margin: 0 auto;
  overflow: hidden;
}

.stories-preview-gallery-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 24px;
  border: 1px solid rgba(255, 247, 240, 0.16);
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.18);
  opacity: 0;
  transform: scale(1.03);
  transition: opacity 240ms ease, transform 240ms ease;
}

.stories-preview-gallery-image.active {
  opacity: 1;
  transform: scale(1);
}

.stories-preview-gallery-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  border-radius: 24px;
  background:
    radial-gradient(circle at top, rgba(255, 143, 156, 0.16), transparent 38%),
    linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.02));
  color: rgba(255,255,255,0.58);
  font-size: 28px;
}

.stories-preview-gallery-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.stories-preview-gallery-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255, 247, 240, 0.22);
  transition: background 220ms ease, transform 220ms ease;
}

.stories-preview-gallery-dot.active {
  background: var(--pink-light);
  transform: scale(1.12);
}

.stories-preview-opening-recipient,
.stories-preview-opening-quote,
.stories-preview-opening-signature,
.stories-preview-quote,
.stories-preview-signature,
.stories-preview-track {
  overflow-wrap: break-word;
  word-break: normal;
}

.stories-preview-track {
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* ── Player estilo Spotify ──────────────────────────────────── */
.player-section {
  padding: 24px 20px 18px;
  background: linear-gradient(180deg, rgba(255,109,186,0.18) 0%, var(--dark-3) 100%);
  position: relative;
  overflow: hidden;
}

/* ── Partículas / corações flutuantes ───────────────────────── */
.player-particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.player-particles span {
  position: absolute;
  bottom: -20px;
  color: var(--pink);
  opacity: 0;
  animation: floatHeart 8s ease-in infinite;
  font-style: normal;
}

.player-particles span:nth-child(1) { left:  7%; font-size:  8px; animation-delay: 0s;   animation-duration: 8s; }
.player-particles span:nth-child(2) { left: 22%; font-size: 11px; animation-delay: 1.8s; animation-duration: 9s; }
.player-particles span:nth-child(3) { left: 42%; font-size:  7px; animation-delay: 3.5s; animation-duration: 7s; }
.player-particles span:nth-child(4) { left: 63%; font-size: 10px; animation-delay: 1s;   animation-duration: 10s; }
.player-particles span:nth-child(5) { left: 80%; font-size:  8px; animation-delay: 2.6s; animation-duration: 8s; }
.player-particles span:nth-child(6) { left: 92%; font-size:  6px; animation-delay: 4.5s; animation-duration: 9s; }

@keyframes floatHeart {
  0%   { transform: translateY(0)     rotate(-12deg); opacity: 0; }
  12%  { opacity: 0.55; }
  88%  { opacity: 0.12; }
  100% { transform: translateY(-220px) rotate(12deg);  opacity: 0; }
}

.player-cover-wrap {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 12px;
  overflow: hidden;
  background: var(--dark-4);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}

.player-cover-placeholder {
  font-size: 56px;
  animation: pulse 3s ease-in-out infinite;
}

@keyframes pulse {
  0%,100% { transform: scale(1); }
  50%      { transform: scale(1.08); }
}

.player-cover-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.8s ease-in-out;
}

.player-meta { margin-bottom: 14px; }

.player-song-name {
  font-size: 16px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text);
}

.player-artist-name {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 3px;
}

.player-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-bottom: 12px;
}

.ctrl-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 14px;
  cursor: pointer;
  padding: 4px;
  transition: color var(--transition);
}

.ctrl-btn.play {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--pink);
  color: #fff;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px var(--pink-glow);
  transition: transform var(--transition), box-shadow var(--transition);
}
.ctrl-btn.play:hover { transform: scale(1.08); box-shadow: 0 6px 20px var(--pink-glow); }

.player-bar {
  height: 3px;
  background: var(--dark-4);
  border-radius: 99px;
  overflow: hidden;
  margin-bottom: 4px;
}

.player-bar-fill {
  height: 100%;
  width: 0%;
  background: var(--pink);
  border-radius: 99px;
  transition: width 0.18s ease;
}

.player-times {
  display: flex;
  justify-content: space-between;
  font-size: 9px;
  color: var(--text-muted);
}

/* ── Seção "Sobre o casal" ──────────────────────────────────── */
.about-section {
  padding: 18px 20px;
  border-top: 1px solid var(--border);
}

.about-names {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 5px;
  color: var(--pink-light);
}

.about-title {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 12px;
  font-style: italic;
}

.about-since {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 7px;
}

.about-since strong { color: var(--text); }

.about-counter {
  display: flex;
  gap: 5px;
  margin-bottom: 10px;
}

.mc-card {
  flex: 1;
  background: var(--dark-4);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 7px 4px;
  text-align: center;
}

.mc-num {
  font-size: 15px;
  font-weight: 700;
  color: var(--pink-light);
  line-height: 1;
  margin-bottom: 3px;
}

.mc-unit {
  font-size: 7px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-muted);
}

.about-city {
  font-size: 12px;
  color: var(--text-muted);
}

/* ── Timeline "Nossa história" ──────────────────────────────── */
.timeline-section {
  padding: 14px 20px 18px;
  border-top: 1px solid var(--border);
}

.timeline-label {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--pink);
  font-weight: 700;
  margin-bottom: 14px;
}

.timeline {
  position: relative;
  padding-left: 14px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 4px;
  top: 8px;
  bottom: 8px;
  width: 1px;
  background: linear-gradient(to bottom, var(--pink), transparent);
  opacity: 0.4;
}

.timeline-item {
  position: relative;
  padding-left: 16px;
  margin-bottom: 16px;
}
.timeline-item:last-child { margin-bottom: 0; }

.tl-dot {
  position: absolute;
  left: -10px;
  top: 4px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--pink);
  box-shadow: 0 0 6px var(--pink-glow);
}

.tl-dot-heart {
  background: none;
  box-shadow: none;
  font-size: 10px;
  width: auto;
  height: auto;
  top: 1px;
  left: -12px;
}

.tl-date {
  font-size: 10px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 2px;
}

.tl-text {
  font-size: 10px;
  color: var(--text-muted);
  line-height: 1.4;
}

/* ── Barra de compartilhamento ──────────────────────────────── */
.share-bar {
  display: flex;
  gap: 8px;
  padding: 12px 20px 16px;
  border-top: 1px solid var(--border);
}

.share-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 9px 6px;
  border-radius: 8px;
  border: none;
  font-family: var(--font);
  font-size: 10px;
  font-weight: 600;
  cursor: default;
}

.share-wpp  { background: #25d366; color: #fff; }
.share-copy { background: var(--dark-4); border: 1px solid var(--border); color: var(--text-muted); }

/* ── Galeria de fotos no mockup ─────────────────────────────── */
.gallery-section {
  padding: 14px 20px 18px;
  border-top: 1px solid var(--border);
}

.gallery-label {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--pink);
  font-weight: 700;
  margin-bottom: 10px;
}

.gallery-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.gallery-thumb {
  flex-shrink: 0;
  width: 62px;
  height: 62px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--dark-4);
  border: 1px solid var(--border);
}

.gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.gallery-empty {
  font-size: 10px;
  color: var(--text-muted);
  font-style: italic;
  padding: 10px 0;
  opacity: 0.55;
}

/* ── Seção de mensagem especial no mockup ───────────────────── */
.prev-capsulas-section {
  padding: 16px 20px 22px;
  border-top: 1px solid var(--border);
}

.msg-section-label {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--pink);
  font-weight: 700;
  margin-bottom: 10px;
}

/* Mini grid de cápsulas no mockup */
.prev-capsulas-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-bottom: 12px;
}

.prev-capsula {
  background: rgba(255,109,186,0.07);
  border: 1px solid rgba(255,109,186,0.18);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px 4px 6px;
  gap: 4px;
  font-size: 16px;
  line-height: 1;
}
.prev-capsula span {
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--pink);
}

/* Mini carta no mockup */
.prev-carta-mini {
  background: rgba(255,109,186,0.04);
  border: 1px solid rgba(255,109,186,0.12);
  border-radius: 8px;
  padding: 10px 10px 10px 18px;
  position: relative;
  overflow: hidden;
}
.prev-carta-mini::before {
  content: '';
  position: absolute;
  left: 10px; top: 0; bottom: 0;
  width: 1px;
  background: rgba(255,109,186,0.18);
}
.prev-carta-mini-linha {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,109,186,0.2), transparent);
  margin-bottom: 8px;
}
.prev-carta-mini-texto {
  font-size: 10px;
  color: var(--text-muted);
  line-height: 1.7;
  font-style: italic;
}

/* ── YouTube overlay no preview ─────────────────────────────── */
/* ── Toast ──────────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--dark-4);
  border: 1px solid var(--border);
  border-radius: 99px;
  padding: 10px 20px;
  font-size: 13px;
  color: var(--text);
  opacity: 0;
  transition: opacity 0.3s, transform 0.3s;
  z-index: 999;
  white-space: nowrap;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ══════════════════════════════════════════════════════════════
   RESPONSIVO — Mobile
══════════════════════════════════════════════════════════════ */
@media (max-width: 900px) {
  /* Grid garante que preview-panel sempre ocupa seu tamanho natural na linha 2,
     e steps-panel preenche todo o restante — sem disputas de flex-basis. */
  .app-wrapper {
    display: grid;
    grid-template-rows: 1fr auto;   /* linha 1: steps; linha 2: preview (tamanho real) */
    flex-direction: column;         /* sem efeito no grid, mantido por segurança */
  }

  .steps-panel {
    min-height: 0;      /* ESSENCIAL no grid: permite encolher abaixo do tamanho do conteúdo */
    max-width: 100%;
    border-right: none;
    overflow: hidden;   /* contém o flex interno */
  }

  /* Preview: fluxo normal na linha 2 do grid.
     column-reverse → preview-header na base, preview-body expande para cima. */
  .preview-panel {
    position: static;
    width: 100%;
    height: auto;
    overflow: visible;
    padding: 0;
    z-index: auto;
    background: var(--dark-2);
    border-top: none;
    border-radius: 0;
    display: flex;
    flex-direction: column-reverse;
    align-items: stretch;
  }

  /* Corpo do preview: escondido por padrão, expande para cima ao abrir */
  .preview-body {
    max-height: 0;
    overflow: hidden;
    background: var(--dark-2);
    border-radius: 24px 24px 0 0;
    transition: max-height 0.45s ease;
  }

  .preview-panel.open .preview-body {
    max-height: 55vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    padding: 20px 20px 24px;
  }

  /* Header: sempre visível na base do preview-panel */
  .preview-header {
    position: static;
    width: 100%;
    background: var(--dark-2);
    border-top: 1px solid var(--border);
    padding: 12px 20px;
    z-index: auto;
    margin-bottom: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 0;
  }

  /* botão toggle visível no mobile */
  .btn-toggle-preview { display: block; }

  /* nav-footer: fluxo normal dentro do steps-panel */
  .nav-footer {
    padding: 10px 0 calc(10px + env(safe-area-inset-bottom, 0px));
    background: var(--dark-2);
    border-top: 1px solid var(--border);
  }
  .nav-footer-inner { padding: 0 16px; }

  /* steps-container: padding mínimo, nav-footer está no fluxo abaixo */
  .steps-container {
    padding-bottom: 8px;
  }

  .phone-mockup { max-width: 220px; margin: 0 auto; }

  /* phone-screen não deve ultrapassar a altura disponível no painel */
  .preview-panel .phone-screen {
    max-height: 55vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .preview-panel .phone-mockup[data-template="stories"] .phone-screen {
    height: min(55vh, 520px);
    overflow: hidden;
  }

  .preview-panel .preview-template-stories {
    min-height: min(55vh, 520px);
  }

  .counter-grid { grid-template-columns: repeat(3, 1fr); }

  .plans-grid { grid-template-columns: 1fr; }

  .gift-options,
  .template-options { grid-template-columns: 1fr 1fr; }

  .music-moment-head {
    flex-direction: column;
  }

  .music-moment-preview-btn {
    width: 100%;
  }

  /* Dropdown de sugestões: garante visibilidade acima do teclado mobile */
  .autocomplete-list {
    max-height: 44vh;
    z-index: 200;
  }
  .music-suggestion-item {
    padding: 12px 12px;
  }
  .suggestion-art {
    width: 44px;
    height: 44px;
  }

  .preview-header-copy {
    align-items: flex-start;
  }
}

@media (max-width: 480px) {
  .steps-container  { padding: 24px 16px 16px; }
  .progress-header  { padding: 12px 16px; }
  .nav-footer       { padding: 10px 0 calc(10px + env(safe-area-inset-bottom, 0px)); }
  .nav-footer-inner { padding: 0 16px; }
  .step-title       { font-size: 19px; }
  .plans-grid       { grid-template-columns: 1fr; }

  .music-moment-picker {
    padding: 16px;
  }

  .music-moment-meta {
    flex-direction: column;
    align-items: flex-start;
  }

  .gift-options,
  .template-options {
    grid-template-columns: 1fr;
  }
}
