/* Mesma fonte do site principal (Inter variável, cópia de site/public/fonts). */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url('../fonts/inter-latin-var.woff2') format('woff2');
}

/* Cores da marca Domus Method (mesma paleta do site principal: ciano #00BBC9) */
:root {
  --ink: #1c1c2e;
  --muted: #6b6b7a;
  --bg: #0b0b12;   /* tema escuro: fundo atrás da foto dos anéis */
  --accent: #00BBC9;
  --accent-hover: #009aaa;
  --accent-soft: #e6f8fa;
  --on-accent: #000000;   /* texto sobre o ciano: preto tem contraste melhor que branco */
  --line: #e3e5ea;
  --danger: #e0245e;
  --success: #1f9d55;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
}

.progress-bar {
  position: fixed;
  top: 0; left: 0;
  width: 100%;
  height: 4px;
  background: var(--line);
  z-index: 20;
}
.progress-bar-fill {
  height: 100%;
  width: 0%;
  background: var(--accent);
  transition: width 0.45s cubic-bezier(.4,0,.2,1);
}

.stage {
  width: 100%;
  max-width: 640px;
  padding: 24px;
  min-height: 100vh;
  display: flex;
  align-items: center;
  position: relative;
  z-index: 1; /* acima dos anéis de fundo (fixed, z-index 0) */
}

.loading { color: var(--muted); font-size: 15px; }

/*
 * Anéis de fundo: parte permanente do layout (fixos atrás do cartão, sempre
 * visíveis). A cada troca de etapa giram no lugar em direções alternadas —
 * anéis 1 e 3 para a esquerda, 2 para a direita — enquanto o conteúdo do
 * cartão troca com um fade. Ver initPortalRings/spinPortalRings em form.js.
 *
 * Os 3 anéis são fatias da imagem de fundo da página atual (BG_IMAGES em form.js): a <img>
 * de cada anel ocupa a tela inteira (100vw x 100vh, cover) e fica centralizada,
 * então cada anel mostra só a sua faixa e, alinhados, formam a foto completa
 * de fundo. O anel maior (142vmax ≈ diagonal da tela) cobre a tela toda.
 * Sem o arquivo, fica o degradê do .ring-fallback.
 */
.rings-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}
.ring {
  position: absolute;
  left: 50%;
  top: 50%;
  border-radius: 50%;
  overflow: hidden;
  transform: translate(-50%, -50%) rotate(0deg);
  transition: transform 0.9s cubic-bezier(.65, 0, .35, 1);
  will-change: transform;
}
.ring-fallback {
  position: absolute;
  inset: 0;
  border-radius: 50%;
}
.rings-bg { --rings-size: 142vmax; }
.ring-image {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 100vw;
  height: 100vh;
  max-width: none;
  transform: translate(-50%, -50%);
  object-fit: cover;
  /* Preto e branco e escurecida, para não brigar com o cartão branco. */
  filter: grayscale(1) brightness(0.55) contrast(1.08);
  transition: opacity 0.3s ease;
}
/* Véu escuro por cima da foto (acima dos anéis, abaixo do cartão). */
.rings-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(6, 6, 10, 0.3), rgba(6, 6, 10, 0.55));
}
/* Com foto: ao girar, os cantos da foto (retangular) saem da tela e sobra
   espaço vazio dentro do anel; preenche com o mesmo tom escuro do fundo da foto. */
.ring.has-image { background: #0e0e12; }
.ring.has-image .ring-fallback { display: none; }
/* Contorno fino em cada camada para os anéis se destacarem quando giram. */
.ring-2 { box-shadow: 0 0 0 1.5px rgba(255, 255, 255, 0.3); }
.ring-3 { box-shadow: 0 0 0 1.5px rgba(255, 255, 255, 0.22); }
.ring-1 { width: var(--rings-size); height: var(--rings-size); }
.ring-1 .ring-fallback {
  background: conic-gradient(var(--accent) 0deg 90deg, var(--accent-hover) 90deg 180deg, var(--accent) 180deg 270deg, var(--accent-hover) 270deg 360deg);
  opacity: 0.14;
}
.ring-2 { width: 70vmax; height: 70vmax; }
.ring-2 .ring-fallback {
  background: conic-gradient(#fff 0deg 90deg, var(--accent) 90deg 180deg, #fff 180deg 270deg, var(--accent) 270deg 360deg);
  opacity: 0.17;
}
.ring-3 { width: 38vmax; height: 38vmax; }
.ring-3 .ring-fallback {
  background: conic-gradient(var(--accent-hover) 0deg 90deg, #fff 90deg 180deg, var(--accent-hover) 180deg 270deg, #fff 270deg 360deg);
  opacity: 0.2;
}

/* Cartão de conteúdo: por cima dos anéis, fundo sólido para o texto ficar legível. */
.step-portal {
  width: 100%;
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  padding: 40px 36px;
  margin: auto;
}

.step-inner {
  width: 100%;
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.22s ease, transform 0.22s ease;
}
.step-inner.is-leaving {
  opacity: 0;
  transform: translateY(-6px);
}
.step-inner.is-entering {
  opacity: 0;
  transform: translateY(6px);
  transition: none;
}

@media (max-width: 600px) {
  .ring { transition-duration: 0.7s; }
  /* Celular em pé: a foto é larga, então mostra o lado direito (rosto em close). */
  .ring-image { object-position: 88% 50%; }
  .step-portal { padding: 28px 20px; border-radius: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .ring, .step-inner, .ring-image { transition: none; }
}

.step-index {
  color: var(--accent-hover);
  font-weight: 700;
  font-size: 14px;
  margin-right: 6px;
}

.step-title {
  font-size: 26px;
  font-weight: 600;
  line-height: 1.35;
  margin: 0 0 6px;
}
.step-title .req-star { color: var(--accent-hover); margin-left: 4px; }

.step-subtitle {
  color: var(--muted);
  font-size: 15.5px;
  line-height: 1.6;
  margin: 0 0 22px;
}

/* Intro / statement screens */
.intro-emoji { font-size: 30px; }
.intro-bullets { font-size: 15.5px; color: var(--muted); margin: 18px 0 22px; line-height: 2; }
/* Tópicos da capa: pontinhos na cor da marca. */
.intro-bullets ul { list-style: none; margin: 0 0 14px; padding: 0; }
.intro-bullets li { position: relative; padding-left: 18px; }
.intro-bullets li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 50%;
  width: 7px;
  height: 7px;
  margin-top: -3.5px;
  border-radius: 50%;
  background: var(--accent);
}
.intro-note { font-style: italic; color: #8b8b98; font-size: 14.5px; margin-bottom: 22px; }

/* Text inputs */
.field-input {
  width: 100%;
  font-size: 19px;
  padding: 14px 16px;
  border: 2px solid var(--line);
  border-radius: 10px;
  outline: none;
  background: #fff;
  color: var(--ink);
  font-family: inherit;
  transition: border-color 0.2s ease;
}
.field-input:focus { border-color: var(--accent); }
.field-input.field-error { border-color: var(--danger); }

.field-error-msg {
  color: var(--danger);
  font-size: 13.5px;
  margin-top: 8px;
  display: none;
}
.field-error-msg.visible { display: block; }

.step-actions {
  margin-top: 18px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.btn-ok {
  background: var(--accent);
  color: var(--on-accent);
  border: none;
  font-weight: 700;
  font-size: 15px;
  font-family: inherit;
  padding: 12px 22px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s ease;
}
.btn-ok:hover { background: var(--accent-hover); }
.btn-ok:disabled { opacity: 0.5; cursor: not-allowed; }

.hint-key { color: #9a9aa6; font-size: 13.5px; }

/* Single choice options */
.options-list { display: flex; flex-direction: column; gap: 10px; }
.option-card {
  text-align: left;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f3f4f6;
  cursor: pointer;
  font-size: 15.5px;
  font-family: inherit;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 12px;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.option-card:hover { border-color: var(--accent); background: var(--accent-soft); }
.option-card.selected { border-color: var(--accent); background: var(--accent-soft); }
.option-radio {
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 2px solid #b7b9c2;
  flex-shrink: 0;
}
.option-card.selected .option-radio { border-color: var(--accent); background: radial-gradient(circle, var(--accent) 0 40%, transparent 41%); }

/* Consent step */
.consent-box {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 18px;
  font-size: 14.5px;
  color: var(--muted);
  cursor: pointer;
}
.consent-box input { margin-top: 3px; accent-color: var(--accent); }
.consent-box a { color: var(--accent-hover); }
.submit-error {
  color: var(--danger);
  font-size: 14px;
  margin-top: 12px;
  display: none;
}
.submit-error.visible { display: block; }

/* Ending screens */
.ending-icon { font-size: 42px; margin-bottom: 10px; }
.ending-title { font-size: 24px; font-weight: 700; margin-bottom: 10px; }
.ending-subtitle { color: var(--muted); font-size: 15.5px; margin-bottom: 20px; line-height: 1.6; }

.specialist-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 22px;
}
.specialist-photo {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--accent);
  flex-shrink: 0;
}
.specialist-photo-fallback {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--on-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 18px;
  flex-shrink: 0;
}
.specialist-name { font-weight: 700; font-size: 15px; }
.specialist-role { color: var(--muted); font-size: 13.5px; }

.calendly-embed {
  min-width: 280px;
  height: 700px;
  border-radius: 12px;
  overflow: hidden;
}

@media (max-width: 600px) {
  .step-title { font-size: 21px; }
  .calendly-embed { height: 620px; }
  .hint-key { display: none; }
}
