:root {
  --bg: #FFFFFF;
  --bg-soft: #FAFAFA;
  --text: #1A1A1A;
  --text-muted: #6B7280;
  --text-dim: #9CA3AF;

  --rosa: #FE2C55;
  --rosa-claro: #FF6B8A;
  --rosa-soft: #FFF1F4;
  --ciano: #25F4EE;

  --border-subtle: rgba(0,0,0,0.08);
  --border-strong: rgba(0,0,0,0.16);

  --gradiente-cta: linear-gradient(135deg, #FE2C55 0%, #FF6B8A 100%);
  --gradiente-rosa: linear-gradient(165deg, #FE2C55 0%, #FF6B8A 50%, #FFB1C2 100%);
  --gradiente-thanks: linear-gradient(170deg, #FFFFFF 0%, #FFF5F7 60%, #FFE6EC 100%);

  --radius: 16px;
  --radius-sm: 12px;
  --tap: 44px;
}

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

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
  text-rendering: optimizeLegibility;
  font-feature-settings: 'cv11', 'ss01';
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  display: flex;
  justify-content: center;
}

#app {
  width: 100%;
  max-width: 480px;
  min-height: 100vh;
  min-height: 100dvh;
  position: relative;
  overflow: hidden;
  background: var(--bg);
}

button { font-family: inherit; }
input, textarea { font-family: inherit; }

/* ----------------- Telas (screen) — crossfade absoluto ----------------- */
.screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  width: 100%;
  padding: calc(env(safe-area-inset-top) + 56px) 24px calc(env(safe-area-inset-bottom) + 24px);
  background: var(--bg);
  opacity: 0;
  transition: opacity 220ms ease;
  will-change: opacity;
}
.screen.enter { opacity: 1; }

/* ----------------- Welcome ----------------- */
.welcome {
  align-items: center;
  text-align: center;
  padding-top: max(72px, 12vh);
}
.welcome-emoji {
  font-size: 92px;
  line-height: 1;
  animation: pulse 3.2s ease-in-out infinite;
  filter: drop-shadow(0 6px 24px rgba(254,44,85,0.16));
  margin-bottom: 28px;
}
@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.05); }
}
.welcome-title {
  font-size: 32px;
  font-weight: 800;
  line-height: 1.12;
  margin-bottom: 14px;
  letter-spacing: -0.02em;
  color: var(--text);
}
.welcome-sub {
  color: var(--text-muted);
  font-size: 15px;
  font-weight: 400;
  line-height: 1.5;
  max-width: 320px;
}
.welcome-cta-wrap {
  margin-top: auto;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 32px;
}
.welcome-meta {
  margin-top: 14px;
  color: var(--text-dim);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.01em;
}

/* ----------------- Botão CTA ----------------- */
.btn {
  width: 100%;
  min-height: var(--tap);
  padding: 16px 24px;
  border: 0;
  border-radius: 999px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 180ms ease, opacity 180ms ease, box-shadow 180ms ease, background 180ms ease;
  user-select: none;
  -webkit-user-select: none;
  letter-spacing: 0.01em;
  will-change: transform;
}
.btn-primary {
  background: var(--gradiente-cta);
  color: #fff;
  box-shadow: 0 8px 22px rgba(254, 44, 85, 0.28), 0 1px 0 rgba(255,255,255,0.18) inset;
}
.btn-primary:active { transform: scale(0.96); box-shadow: 0 4px 12px rgba(254,44,85,0.36); }
.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  box-shadow: none;
}
.btn:disabled:active { transform: none; }
.btn-ghost {
  background: #fff;
  color: var(--text);
  border: 1px solid var(--border-strong);
  box-shadow: none;
}
.btn-ghost:active { background: var(--bg-soft); transform: scale(0.97); }

/* ----------------- Transição entre blocos (rosa, único momento de cor cheia) ----------------- */
.block-transition {
  align-items: center;
  justify-content: center;
  text-align: center;
  cursor: pointer;
  background: var(--gradiente-rosa);
  color: #fff;
}
.block-label {
  font-size: 13px;
  font-weight: 600;
  color: rgba(255,255,255,0.75);
  letter-spacing: 0.14em;
  margin-bottom: 14px;
  text-transform: uppercase;
}
.block-name {
  font-size: clamp(28px, 7.6vw, 42px);
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  line-height: 1.1;
  color: #fff;
  padding: 0 8px;
  text-shadow: 0 2px 18px rgba(0,0,0,0.12);
}
.block-hint {
  position: absolute;
  bottom: max(28px, env(safe-area-inset-bottom));
  font-size: 11px;
  color: rgba(255,255,255,0.7);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* ----------------- Tela de pergunta ----------------- */
.progress {
  position: absolute;
  top: env(safe-area-inset-top);
  left: 0;
  right: 0;
  height: 3px;
  background: rgba(0,0,0,0.06);
  z-index: 5;
}
.progress-bar {
  height: 100%;
  background: var(--gradiente-cta);
  width: 0%;
  transition: width 480ms cubic-bezier(0.22, 0.61, 0.36, 1);
}

.back-btn {
  position: absolute;
  top: calc(env(safe-area-inset-top) + 12px);
  left: 12px;
  width: var(--tap);
  height: var(--tap);
  border: 0;
  background: transparent;
  color: var(--text-muted);
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 4;
  transition: background 160ms, transform 160ms, color 160ms;
}
.back-btn:active { background: var(--bg-soft); transform: scale(0.92); color: var(--text); }

.q-counter {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 14px;
  margin-top: 4px;
  letter-spacing: 0.02em;
}
.q-title {
  font-size: 22px;
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 24px;
  letter-spacing: -0.012em;
  color: var(--text);
}
.q-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  padding-bottom: 110px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.q-content::-webkit-scrollbar { display: none; }

.q-bottom {
  position: absolute;
  bottom: max(20px, env(safe-area-inset-bottom));
  left: 24px;
  right: 24px;
  display: flex;
  gap: 10px;
  z-index: 3;
}
.q-bottom .btn { flex: 1; }

/* fade gradiente sobre o conteúdo, antes dos botões fixos */
.q-bottom-fade {
  position: absolute;
  left: 0; right: 0;
  bottom: max(20px, env(safe-area-inset-bottom));
  height: 80px;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.85) 60%, #fff 100%);
  z-index: 2;
}

/* Layout específico q13 (textarea + 2 botões): scroll-friendly com teclado virtual */
.screen.has-textarea .q-content { padding-bottom: 16px; }
.screen.has-textarea .q-bottom { position: sticky; bottom: max(12px, env(safe-area-inset-bottom)); margin-top: 12px; }
.screen.has-textarea .q-bottom-fade { display: none; }

/* ---------- Card de opção (single/multi) ---------- */
.opt {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: var(--tap);
  padding: 16px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: #fff;
  color: var(--text);
  font-size: 15px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: transform 160ms ease, border-color 200ms ease, background 200ms ease, box-shadow 200ms ease;
  line-height: 1.4;
  opacity: 0;
  animation: cardIn 280ms cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
}
.opt:active { transform: scale(0.97); }
@media (hover: hover) {
  .opt:hover { border-color: var(--border-strong); background: var(--bg-soft); }
}
.opt.selected {
  border-color: var(--rosa);
  background: var(--rosa-soft);
  color: var(--text);
  box-shadow: 0 0 0 3px rgba(254,44,85,0.10), 0 6px 18px rgba(254,44,85,0.12);
  font-weight: 600;
}

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

.opt-checkbox {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 1.5px solid var(--border-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: auto;
  transition: all 200ms ease;
  background: #fff;
}
.opt.selected .opt-checkbox {
  border-color: var(--rosa);
  background: var(--rosa);
}
.opt-checkbox svg { opacity: 0; transition: opacity 160ms ease; }
.opt.selected .opt-checkbox svg { opacity: 1; }
.opt-other-input {
  width: 100%;
  margin-top: 8px;
  padding: 14px 16px;
  background: #fff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 15px;
  transition: border-color 200ms ease, background 200ms ease;
}
.opt-other-input::placeholder { color: var(--text-dim); }
.opt-other-input:focus {
  outline: none;
  border-color: var(--rosa);
  background: var(--rosa-soft);
}

/* ---------- Picture choice (split com divisória branca interna) ---------- */
.pic-row {
  display: flex;
  width: 100%;
  flex: 1;
  min-height: 50vh;
  border-radius: var(--radius);
  overflow: hidden;
  background: #fff;       /* cor do gap entre as imagens */
  gap: 4px;               /* divisória branca interna */
  opacity: 0;
  animation: cardIn 280ms cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
}
/* 4 opções → grid 2x2 (quadrantes) */
.pic-row.cols-4 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  min-height: 60vh;
  gap: 4px;
}
.pic-side {
  flex: 1;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  background-size: cover;
  background-position: center;
  background-color: var(--bg-soft);
  cursor: pointer;
  overflow: hidden;
  transition: transform 200ms ease, filter 200ms ease;
  -webkit-tap-highlight-color: transparent;
  border: 0;
  padding: 0;
  font-family: inherit;
  color: inherit;
  appearance: none;
  -webkit-appearance: none;
}
.pic-side:active { transform: scale(0.98); }
.pic-side.placeholder {
  background: linear-gradient(135deg, #FE2C55 0%, #FF6B8A 50%, #FFB1C2 100%);
}
.pic-side.placeholder::before {
  content: attr(data-letter);
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(72px, 18vw, 120px);
  font-weight: 800;
  color: #fff;
  text-shadow: 0 6px 28px rgba(0,0,0,0.18);
  letter-spacing: -0.02em;
}
.pic-side-label {
  position: relative;
  z-index: 1;
  background: linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(0,0,0,0.55) 100%);
  color: #fff;
  padding: 32px 12px 16px;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  line-height: 1.3;
  text-shadow: 0 1px 8px rgba(0,0,0,0.4);
}
.pic-side.selected {
  filter: brightness(1.04);
}
.pic-side.selected::after {
  content: '';
  position: absolute;
  inset: 0;
  border: 4px solid var(--rosa);
  pointer-events: none;
  box-shadow: 0 0 0 3px rgba(254,44,85,0.16) inset;
  z-index: 2;
}
.pic-side .pic-check {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--rosa);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 180ms ease, transform 180ms cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 3;
  box-shadow: 0 4px 12px rgba(254,44,85,0.32);
}
.pic-side.selected .pic-check { opacity: 1; transform: scale(1); }

/* ---------- Long text ---------- */
.long-text {
  width: 100%;
  min-height: 168px;
  resize: vertical;
  padding: 16px;
  background: #fff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 15px;
  line-height: 1.55;
  transition: border-color 200ms ease, background 200ms ease, box-shadow 200ms ease;
}
.long-text::placeholder { color: var(--text-dim); }
.long-text:focus {
  outline: none;
  border-color: var(--rosa);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(254,44,85,0.08);
}

/* ----------------- Thank You ----------------- */
.thanks {
  align-items: center;
  justify-content: center;
  text-align: center;
  background: var(--gradiente-thanks);
}
.thanks-check {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border: 2px solid var(--rosa);
  margin-bottom: 32px;
  box-shadow: 0 0 32px rgba(254,44,85,0.18), 0 8px 24px rgba(0,0,0,0.04);
  animation: checkPulse 2.4s ease-in-out infinite;
}
@keyframes checkPulse {
  0%, 100% { box-shadow: 0 0 32px rgba(254,44,85,0.18), 0 8px 24px rgba(0,0,0,0.04); }
  50%      { box-shadow: 0 0 48px rgba(254,44,85,0.32), 0 8px 24px rgba(0,0,0,0.04); }
}
.thanks-check svg path {
  stroke-dasharray: 60;
  stroke-dashoffset: 60;
  animation: drawCheck 1s ease-out 200ms forwards;
}
@keyframes drawCheck {
  to { stroke-dashoffset: 0; }
}
.thanks-title {
  font-size: 28px;
  font-weight: 800;
  margin-bottom: 12px;
  letter-spacing: -0.02em;
  color: var(--text);
}
.thanks-sub {
  color: var(--text-muted);
  font-size: 15px;
  margin-bottom: 32px;
  max-width: 320px;
  line-height: 1.5;
}
.thanks-form {
  width: 100%;
  max-width: 360px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.thanks-input {
  width: 100%;
  padding: 16px;
  background: #fff;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 15px;
  text-align: center;
  transition: border-color 200ms ease, background 200ms ease, box-shadow 200ms ease;
}
.thanks-input::placeholder { color: var(--text-dim); }
.thanks-input:focus {
  outline: none;
  border-color: var(--rosa);
  box-shadow: 0 0 0 3px rgba(254,44,85,0.08);
}
.thanks-final-title {
  font-size: 40px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
  background: linear-gradient(135deg, var(--rosa), var(--rosa-claro) 50%, #FF9DB1);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: gradientShift 6s ease-in-out infinite;
  background-size: 200% 200%;
}
@keyframes gradientShift {
  0%, 100% { background-position: 0% 50%; }
  50%      { background-position: 100% 50%; }
}

/* ----------------- Skip link ----------------- */
.text-skip {
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 12px;
  text-decoration: underline;
  cursor: pointer;
  background: transparent;
  border: 0;
  padding: 8px;
}
.text-skip:active { color: var(--text); }

/* Tela offline / erro */
.banner-offline {
  position: fixed;
  top: env(safe-area-inset-top);
  left: 0; right: 0;
  background: var(--rosa);
  color: #fff;
  text-align: center;
  font-size: 13px;
  padding: 8px;
  z-index: 100;
  display: none;
  font-weight: 500;
}
.banner-offline.show { display: block; }

/* Responsivo: telas muito pequenas */
@media (max-height: 640px) {
  .welcome { padding-top: max(48px, 8vh); }
  .welcome-emoji { font-size: 72px; margin-bottom: 18px; }
  .welcome-title { font-size: 26px; }
  .welcome-sub   { font-size: 14px; }
  .q-title       { font-size: 20px; margin-bottom: 16px; }
}
@media (min-width: 600px) {
  #app { box-shadow: 0 4px 60px rgba(0,0,0,0.06); }
}

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 100ms !important;
  }
  .opt, .pic-opt { opacity: 1; }
}
