/* ============================================================
   CLÍNICA TRINDADE — FORMULÁRIO MULTI-ETAPAS
   Design Premium | Quiropraxia | Acolhimento | Mobile First
   ============================================================ */

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

:root {
  /* Paleta principal — extraída da logo real da Clínica Trindade */
  /* Azul acinzentado */
  --primary:       #798E9F;
  --primary-dark:  #5B6B77;
  --primary-mid:   #8699A9;
  --primary-light: #9BAAB7;

  /* Verde sálvia (oliva) */
  --accent:        #B0B187;
  --accent-light:  #DBDCC9;
  --accent-dark:   #848564;

  /* Laranja suave — CTA principal */
  --orange:        #DE8658;
  --orange-dark:   #B26B46;
  --orange-light:  #F0C9B4;

  /* Neutros — fundo off-white */
  --bg:            #FAF7F1;
  --white:         #FFFFFF;
  --cream:         #F7F4EC;
  --surface:       #F4F0E7;
  --border:        #E3DCCD;

  /* Tipografia */
  --text:          #33403D;
  --text-light:    #52645F;
  --text-muted:    #8B9A93;

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

  /* 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-md:      0 4px 20px rgba(0,0,0,.10);
  --shadow-lg:      0 8px 40px rgba(0,0,0,.14);
  --shadow-accent:  0 4px 24px rgba(176,177,135,.28);
  --shadow-primary: 0 4px 24px rgba(222,134,88,.35);

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

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

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

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;
}

/* ============================================================
   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 10px rgba(121,142,159,.08);
}

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

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

.progress-bar::after {
  content: '';
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--accent-dark), var(--accent));
  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);
  animation: none;
}

.screen.active {
  display: flex;
  opacity: 1;
  transform: translateX(0);
  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;
  justify-content: space-between;
  padding: 16px 20px 0;
}

.btn-back {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background: var(--white);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-light);
  transition: var(--transition);
  -webkit-tap-highlight-color: transparent;
  flex-shrink: 0;
}

.btn-back:hover { background: var(--surface); border-color: var(--accent); color: var(--accent); }
.btn-back:active { transform: scale(.93); }

.screen-step {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--surface);
  padding: 4px 12px;
  border-radius: 100px;
  border: 1px solid var(--border);
  letter-spacing: .05em;
  font-family: var(--font-heading);
}

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

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

/* ============================================================
   TELA 0 — LANDING
   ============================================================ */
.landing-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}

/* Hero foto */
.landing-hero {
  position: relative;
  width: 100%;
  height: 48vh;
  min-height: 210px;
  overflow: hidden;
  background: var(--primary-dark);
  flex-shrink: 0;
}

.landing-hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* Foto enquadrada da cintura para cima: ancorar no topo evita cortar cabeça/pescoço */
  object-position: center top;
}

.landing-hero-fallback {
  display: none;
  width: 100%;
  height: 100%;
  background: linear-gradient(160deg, var(--primary-dark) 0%, var(--primary) 60%, var(--accent-dark) 120%);
  color: var(--accent-light);
  font-family: var(--font-heading);
  font-size: 42px;
  font-weight: 700;
  letter-spacing: .04em;
  align-items: center;
  justify-content: center;
}

.landing-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    transparent 0%,
    transparent 52%,
    rgba(255,255,255,.3) 78%,
    rgba(255,255,255,1) 100%
  );
}

/* Conteúdo da landing */
.landing-content {
  padding: 8px 22px 14px;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

/* Profissionais — exibido logo abaixo da fotografia */
.landing-professionals {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px 10px;
  font-family: var(--font-heading);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-light);
  margin-bottom: 8px;
}

.professional-name em {
  font-style: normal;
  font-weight: 700;
  color: var(--accent-dark);
  margin-left: 4px;
}

.professional-divider { color: var(--border); }

/* Linha decorativa */
.landing-divider {
  width: 36px;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 100px;
  margin-bottom: 10px;
  flex-shrink: 0;
}

/* Headline principal */
.landing-title {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 700;
  color: var(--primary-dark);
  line-height: 1.3;
  letter-spacing: -.02em;
  margin-bottom: 6px;
}

/* Subheadline */
.landing-sub {
  font-size: 13px;
  color: var(--text-light);
  line-height: 1.5;
  margin-bottom: 12px;
  max-width: 320px;
}

/* ============================================================
   QUESTÕES
   ============================================================ */
.question-hint {
  font-size: 10px;
  font-weight: 700;
  color: var(--accent-dark);
  text-transform: uppercase;
  letter-spacing: .14em;
  margin-bottom: 8px;
  font-family: var(--font-heading);
}

.question-title {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 700;
  color: var(--primary-dark);
  line-height: 1.3;
  margin-bottom: 20px;
  letter-spacing: -.01em;
}

.question-desc {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: -12px;
  margin-bottom: 16px;
  line-height: 1.5;
}

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

.option-card {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 14px;
  padding: 13px 16px;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
  -webkit-tap-highlight-color: transparent;
  text-align: left;
  user-select: none;
  width: 100%;
}

/* Indicador — radio (seleção única) */
.option-indicator {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--border);
  flex-shrink: 0;
  position: relative;
  transition: var(--transition);
  background: var(--white);
}

/* Indicador — checkbox (múltipla seleção) */
.option-card--multi .option-indicator {
  border-radius: 6px;
}

.option-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.35;
  flex: 1;
}

/* Hover */
.option-card:hover {
  border-color: var(--accent);
  background: rgba(176,177,135,.05);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.option-card:active { transform: scale(.97); }

/* Selecionado */
.option-card.selected {
  border-color: var(--accent);
  background: linear-gradient(135deg, rgba(176,177,135,.08) 0%, rgba(121,142,159,.04) 100%);
  box-shadow: 0 0 0 3px rgba(176,177,135,.15), var(--shadow-sm);
}

.option-card.selected .option-indicator {
  border-color: var(--accent);
  background: var(--accent);
}

.option-card.selected .option-indicator::after {
  content: '';
  position: absolute;
  left: 6px;
  top: 3px;
  width: 5px;
  height: 9px;
  border: 2px solid white;
  border-top: none;
  border-left: none;
  transform: rotate(45deg);
}

.option-card.selected .option-label {
  color: var(--primary-dark);
  font-weight: 600;
}

/* Animação de seleção */
.option-card.selecting { animation: selectPulse .28s ease-out; }

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

/* Erro para múltipla seleção */
.options-error {
  font-size: 12px;
  font-weight: 500;
  color: var(--error);
  display: none;
  margin-top: -6px;
  margin-bottom: 10px;
  padding-left: 2px;
}

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

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

/* Campo de texto complementar reutilizável (ex.: "Outra região", "Outro"...) */
.extra-field {
  margin-top: -6px;
  margin-bottom: 16px;
}

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

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

.text-input:focus {
  border-color: var(--accent);
  background: var(--white);
  box-shadow: 0 0 0 3px rgba(176,177,135,.15);
}

.text-input.error {
  border-color: var(--error);
  box-shadow: 0 0 0 3px rgba(239,68,68,.12);
}

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

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

/* ============================================================
   BOTÕES
   ============================================================ */
.btn-primary {
  width: 100%;
  padding: 14px 20px;
  background: linear-gradient(135deg, var(--orange-dark) 0%, var(--orange) 100%);
  color: var(--white);
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .05em;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: var(--transition);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  box-shadow: var(--shadow-primary);
  position: relative;
  overflow: hidden;
}

.btn-primary::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,.12) 0%, transparent 60%);
  opacity: 0;
  transition: var(--transition);
}

.btn-primary:hover::before { opacity: 1; }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 28px rgba(178,107,70,.45); }
.btn-primary:active { transform: scale(.97); }
.btn-primary:disabled { opacity: .6; cursor: not-allowed; transform: none; }

/* Spinner */
.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); } }

/* Botão WhatsApp */
.btn-whatsapp {
  width: 100%;
  max-width: 300px;
  padding: 16px 24px;
  background: var(--whatsapp);
  color: var(--white);
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 700;
  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);
  box-shadow: 0 4px 20px rgba(37,211,102,.35);
  -webkit-tap-highlight-color: transparent;
}

.btn-whatsapp:hover { transform: translateY(-1px); filter: brightness(1.05); }
.btn-whatsapp:active { transform: scale(.97); }

/* Nota de privacidade */
.privacy-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 8px;
  text-align: center;
}

/* ============================================================
   TELA DE SUCESSO
   ============================================================ */
#successContent {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
}

.success-animation { margin-bottom: 4px; }

.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;
  stroke-miterlimit: 10;
  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-logo {
  width: 130px;
  height: auto;
  opacity: .9;
  margin-top: 4px;
}

.success-title {
  font-family: var(--font-heading);
  font-size: 26px;
  font-weight: 700;
  color: var(--primary-dark);
  letter-spacing: -.02em;
}

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

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

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

.dot {
  width: 7px;
  height: 7px;
  background: var(--accent);
  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: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

/* ============================================================
   LANDING — AJUSTES
   ============================================================ */
.landing-content .btn-primary { max-width: 100%; }

/* ============================================================
   UTILS
   ============================================================ */
.hidden { display: none !important; }
.mt-auto { margin-top: auto; }

/* ============================================================
   RESPONSIVO — Desktop
   ============================================================ */
@media (min-width: 480px) {
  body {
    align-items: center;
    padding: 32px 16px;
    background: var(--bg);
  }

  .form-wrapper {
    min-height: auto;
    border-radius: var(--radius-xl);
    box-shadow: 0 20px 60px rgba(121,142,159,.20);
    overflow: hidden;
  }

  .landing-hero { height: 420px; }
  .landing-body { min-height: auto; }
  .landing-title { font-size: 22px; }
}

@media (min-width: 768px) {
  .landing-title  { font-size: 24px; }
  .question-title { font-size: 22px; }
  .success-title  { font-size: 28px; }
}
