/* ============================================================
   DRA. KÁTIA DOSSO — FORMULÁRIO MULTI-ETAPAS
   Direito Imobiliário, Notarial e Registral | Mobile First
   ============================================================ */

/* ---- Reset & Base ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Paleta principal */
  --navy:          #0f1420;
  --navy-light:    #1a2236;
  --navy-soft:     #2a3550;

  --gold:          #c9a96e;
  --gold-light:    #e2c99b;
  --gold-dark:     #a07840;

  --whatsapp:      #25d366;

  /* Neutros */
  --bg:            #ffffff;
  --white:         #ffffff;
  --surface:       #fafafa;
  --border:        #e5e5e5;

  /* Tipografia */
  --text:          #0f1420;
  --text-light:    #737373;
  --text-muted:    #a3a3a3;

  /* Feedback */
  --success:       #22c55e;
  --error:         #ef4444;

  /* Raios */
  --radius-sm:     8px;
  --radius-md:     14px;
  --radius-lg:     20px;
  --radius-xl:     28px;

  /* Sombras */
  --shadow-sm:      0 2px 8px rgba(0,0,0,.06);
  --shadow-card:    0 4px 20px rgba(0,0,0,.10);
  --shadow-gold:    0 4px 24px rgba(201,169,110,.35);
  --shadow-whatsapp: 0 4px 20px rgba(37,211,102,.35);

  /* Fontes */
  --font-sans: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;

  --transition: .22s cubic-bezier(.4,0,.2,1);
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  background: var(--bg);
  min-height: 100dvh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  color: var(--text);
  overflow-x: hidden;
}

* { -webkit-tap-highlight-color: transparent; }

/* ============================================================
   WRAPPER
   ============================================================ */
.form-wrapper {
  width: 100%;
  max-width: 480px;
  min-height: 100dvh;
  background: var(--white);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

/* ============================================================
   BARRA DE PROGRESSO
   ============================================================ */
.progress-bar-container {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--white);
  padding: 12px 20px 8px;
  display: none;
  align-items: center;
  gap: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
}

.progress-bar-container.visible { display: flex; }

.progress-bar {
  flex: 1;
  height: 5px;
  background: var(--border);
  border-radius: 100px;
  overflow: hidden;
}

.progress-bar::after {
  content: '';
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--gold-dark), var(--gold));
  border-radius: 100px;
  width: var(--progress, 0%);
  transition: width .5s cubic-bezier(.4,0,.2,1);
}

.progress-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
  min-width: 64px;
  text-align: right;
}

/* ============================================================
   SCREENS — SISTEMA DE TRANSIÇÃO
   ============================================================ */
.screen {
  display: none;
  flex-direction: column;
  flex: 1;
  opacity: 0;
  transform: translateX(40px);
}

.screen.active {
  display: flex;
  animation: slideIn var(--transition) forwards;
}

.screen.exit { animation: slideOut var(--transition) forwards; }

@keyframes slideIn {
  from { opacity: 0; transform: translateX(40px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes slideOut {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(-40px); }
}

.screen.slide-back.active { animation: slideInBack var(--transition) forwards; }

@keyframes slideInBack {
  from { opacity: 0; transform: translateX(-40px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ============================================================
   HEADER DAS PERGUNTAS
   ============================================================ */
.screen-header {
  display: flex;
  align-items: center;
  padding: 8px 20px 0;
}

.btn-back {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--white);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--navy);
  transition: var(--transition);
  flex-shrink: 0;
}

.btn-back:hover { border-color: var(--gold); }
.btn-back:active { transform: scale(.95); }

/* ============================================================
   BODY DAS TELAS
   ============================================================ */
.screen-body {
  padding: 16px 20px 32px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.screen-body--center {
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 16px;
  padding: 24px 24px 32px;
}

/* ============================================================
   HERO
   ============================================================ */
.hero-body {
  align-items: center;
  text-align: center;
  padding: 16px 0 24px;
}

.hero-photo-wrap {
  position: relative;
  width: 100%;
  flex-shrink: 0;
  padding: 0 24px;
}

.hero-photo-glow {
  position: absolute;
  inset: 6px 18px -6px 30px;
  border-radius: 22px;
  background: linear-gradient(135deg, var(--gold-dark), var(--gold));
  opacity: .2;
  filter: blur(16px);
}

.hero-photo {
  position: relative;
  z-index: 1;
  height: 240px;
  width: 100%;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: #d4d4d4;
  box-shadow: var(--shadow-card);
}

.hero-photo img {
  height: 100%;
  width: 100%;
  object-fit: cover;
  object-position: center 26%;
}

.hero-identity {
  margin: 12px 0;
  padding: 0 24px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.hero-identity strong {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -.01em;
  color: var(--navy);
}

.hero-identity span {
  font-size: 14px;
  color: var(--text-light);
}

.hero-identity em {
  font-style: normal;
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--gold-dark);
}

.hero-divider {
  width: 36px;
  height: 2px;
  border-radius: 100px;
  background: linear-gradient(90deg, var(--gold-dark), var(--gold));
  margin-bottom: 12px;
}

.hero-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--navy);
  line-height: 1.3;
  letter-spacing: -.01em;
  margin-bottom: 8px;
  padding: 0 24px;
}

.hero-sub {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 16px;
  padding: 0 24px;
}

.hero-benefits {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
  padding: 0 24px;
  width: 100%;
  max-width: 320px;
  text-align: left;
}

.hero-benefit {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 500;
  color: var(--navy);
}

.hero-benefit-check {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold-dark), var(--gold));
  color: var(--white);
  font-size: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-gold);
}

.hero-privacy {
  margin-top: 10px;
  padding: 0 24px;
  font-size: 12px;
  color: var(--text-muted);
}

/* ============================================================
   QUESTÕES
   ============================================================ */
.question-hint {
  font-size: 13px;
  font-weight: 600;
  color: var(--gold-dark);
  text-transform: uppercase;
  letter-spacing: .03em;
  margin-bottom: 8px;
}

.question-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.3;
  margin-bottom: 28px;
  letter-spacing: -.01em;
}

.question-desc {
  font-size: 14px;
  color: var(--text-light);
  margin-top: -20px;
  margin-bottom: 24px;
  line-height: 1.5;
}

/* ============================================================
   OPÇÕES — LISTA E GRID
   ============================================================ */
.options-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.options-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

.option-card {
  display: flex;
  border: 2px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
  text-align: left;
  user-select: none;
  width: 100%;
  font-family: inherit;
}

.options-list .option-card {
  flex-direction: row;
  align-items: center;
  gap: 14px;
  padding: 16px;
}

.options-grid .option-card {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 20px;
  text-align: center;
}

.option-icon {
  line-height: 1;
  flex-shrink: 0;
}

.options-list .option-icon { font-size: 22px; }
.options-grid .option-icon { font-size: 28px; }

.option-label {
  font-size: 15px;
  font-weight: 600;
  color: var(--navy);
  line-height: 1.35;
}

.options-list .option-label { flex: 1; }

.option-card:hover { border-color: var(--gold); background: rgba(201,169,110,.05); }
.option-card:active { transform: scale(.96); }

.option-card.selected {
  border-color: var(--gold);
  background: linear-gradient(135deg, rgba(201,169,110,.10) 0%, rgba(201,169,110,.05) 100%);
  box-shadow: 0 0 0 3px rgba(201,169,110,.18);
}

.option-card.selected .option-label { color: var(--gold-dark); }

.option-card.selecting { animation: selectPulse .3s ease-out; }

@keyframes selectPulse {
  0%   { transform: scale(1); }
  40%  { transform: scale(.95); }
  100% { transform: scale(1); }
}

/* ============================================================
   INPUTS
   ============================================================ */
.input-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 24px;
}

.extra-field { margin-top: -8px; margin-bottom: 16px; }

.text-input {
  width: 100%;
  padding: 16px;
  font-size: 16px;
  font-weight: 500;
  color: var(--navy);
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  outline: none;
  transition: var(--transition);
  -webkit-appearance: none;
  font-family: inherit;
}

.text-input::placeholder { color: var(--text-muted); font-weight: 400; }

.text-input:focus {
  border-color: var(--gold);
  background: var(--white);
  box-shadow: 0 0 0 3px rgba(201,169,110,.15);
}

.text-input.error { border-color: #f87171; }

.input-error {
  font-size: 12px;
  font-weight: 500;
  color: var(--error);
  display: none;
}

.input-error.visible { display: block; }

/* ============================================================
   BOTÕES
   ============================================================ */
.btn-primary {
  width: 100%;
  padding: 16px 24px;
  background: linear-gradient(135deg, var(--gold-dark) 0%, var(--gold) 100%);
  color: var(--white);
  font-size: 15px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .03em;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: var(--transition);
  touch-action: manipulation;
  box-shadow: var(--shadow-gold);
  font-family: inherit;
}

.btn-primary:active { transform: scale(.97); }
.btn-primary:disabled { opacity: .7; cursor: not-allowed; }

/* .btn-primary é width:100% por padrão (correto nas telas de pergunta, cujo
   .screen-body já tem padding horizontal). No hero, .hero-body não tem esse
   padding — cada filho o aplica individualmente — então o CTA precisa da
   mesma margem lateral dos demais elementos, em vez de esticar ponta a ponta. */
.hero-cta {
  width: calc(100% - 48px);
  margin: 0 auto;
  font-size: 13.5px;
  white-space: nowrap;
}

.btn-spinner {
  width: 18px;
  height: 18px;
  border: 2.5px solid rgba(255,255,255,.35);
  border-top-color: var(--white);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

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

.btn-whatsapp {
  width: 100%;
  max-width: 300px;
  padding: 16px 24px;
  background: var(--whatsapp);
  color: var(--white);
  font-size: 15px;
  font-weight: 700;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: var(--transition);
  box-shadow: var(--shadow-whatsapp);
  font-family: inherit;
}

.btn-whatsapp:active { transform: scale(.97); }

.btn-link {
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--gold-dark);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ============================================================
   TELA DE SUCESSO
   ============================================================ */
.success-circle { width: 80px; height: 80px; margin: 0 auto; }
.checkmark { width: 80px; height: 80px; }

.checkmark-circle {
  stroke: var(--success);
  stroke-width: 2;
  stroke-dasharray: 166;
  stroke-dashoffset: 166;
  animation: stroke .6s cubic-bezier(.65,0,.45,1) forwards;
}

.checkmark-check {
  stroke: var(--success);
  stroke-width: 2;
  stroke-dasharray: 48;
  stroke-dashoffset: 48;
  stroke-linecap: round;
  stroke-linejoin: round;
  animation: stroke .3s cubic-bezier(.65,0,.45,1) .5s forwards;
}

@keyframes stroke { 100% { stroke-dashoffset: 0; } }

.success-title {
  font-size: 26px;
  font-weight: 800;
  color: var(--navy);
  letter-spacing: -.01em;
}

.success-text {
  font-size: 15px;
  color: var(--text-light);
  line-height: 1.6;
  max-width: 280px;
}

.redirect-loader {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
}

.loader-dots { display: flex; gap: 6px; }

.dot {
  width: 8px;
  height: 8px;
  background: var(--gold);
  border-radius: 50%;
  animation: bounce 1.2s infinite ease-in-out;
}

.dot:nth-child(2) { animation-delay: .2s; }
.dot:nth-child(3) { animation-delay: .4s; }

@keyframes bounce {
  0%, 80%, 100% { transform: scale(.8); opacity: .4; }
  40% { transform: scale(1.1); opacity: 1; }
}

.redirect-text { font-size: 13px; color: var(--text-muted); font-weight: 500; }

/* ============================================================
   UTILS
   ============================================================ */
.hidden { display: none !important; }

/* ============================================================
   RESPONSIVO — Desktop
   ============================================================ */
@media (min-width: 480px) {
  body { align-items: center; padding: 32px 16px; background: var(--surface); }
  .form-wrapper { min-height: auto; border-radius: var(--radius-xl); box-shadow: var(--shadow-card); }
}
