/* ==========================================================================
   Fade&Co | Briefing de Webdesign & Site - Estilos
   Segue o Guia Funcional do Formulário Interativo: paleta institucional,
   Area Variable (Bold nas perguntas, Regular nos subtítulos, Thin nos textos
   de apoio, Bold nos rodapés), uma pergunta por vez e setas no canto.
   ========================================================================== */

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

:root {
  --bg: #060606;
  --text: #f2eadf;
  --accent: #d64109;
  --accent-hover: #e54b0e;
  --accent-soft: rgba(214, 65, 9, 0.16);
  --accent-text: #ff7a4d;
  --muted: rgba(242, 234, 223, 0.62);
  --faint: rgba(242, 234, 223, 0.32);
  --line: rgba(242, 234, 223, 0.22);
  --surface: rgba(242, 234, 223, 0.035);

  --font: "area-variable", "Area Variable", "Area Normal", "Area", "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --w-bold: 700;
  --w-regular: 400;
  --w-thin: 100;

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --gutter: clamp(20px, 5vw, 64px);
}

/* Sem a Area carregada, o corte Thin da Inter fica fino demais sobre o preto */
.no-area {
  --w-thin: 300;
}

html,
body {
  height: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow: hidden;
}

button,
input,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  background: none;
  border: 0;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

a {
  color: inherit;
}

::selection {
  background: var(--accent);
  color: var(--text);
}

/* --- Progresso: linha fina no topo --- */
.bf-progress {
  position: fixed;
  inset: 0 0 auto 0;
  height: 3px;
  background: rgba(214, 65, 9, 0.18);
  z-index: 20;
}

.bf-progress-fill {
  height: 100%;
  width: 0;
  background: var(--accent);
  transition: width 0.6s var(--ease);
}

/* --- Topo --- */
.bf-top {
  position: fixed;
  inset: 3px 0 auto 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px var(--gutter);
  z-index: 15;
  pointer-events: none;
  background: linear-gradient(180deg, var(--bg) 55%, rgba(6, 6, 6, 0));
}

/* A imagem do logo tem bastante margem transparente; as margens negativas compensam */
.bf-logo {
  pointer-events: auto;
  display: block;
  margin: -34px 0 -34px -30px;
}

.bf-logo img {
  display: block;
  height: 132px;
  width: auto;
}

.bf-saved {
  font-size: 13px;
  font-weight: var(--w-thin);
  color: var(--muted);
  opacity: 0;
  transition: opacity 0.4s ease;
}

.bf-saved.is-on {
  opacity: 1;
}

/* --- Palco (área rolável onde cada etapa aparece) --- */
.bf-stage {
  position: fixed;
  inset: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  padding: 110px var(--gutter) 120px;
}

.bf-step {
  width: 100%;
  max-width: 760px;
  margin: auto;
  transition: opacity 0.45s var(--ease), transform 0.45s var(--ease);
}

.bf-step.is-entering {
  opacity: 0;
  transform: translateY(28px);
}

.bf-step.is-entering.from-top {
  transform: translateY(-28px);
}

.bf-step.is-leaving {
  opacity: 0;
  transform: translateY(-28px);
  transition-duration: 0.22s;
}

.bf-step.is-leaving.to-bottom {
  transform: translateY(28px);
}

.bf-noscript {
  margin: auto;
  font-size: 18px;
}

/* --- Cabeçalho da pergunta --- */
.bf-section {
  display: block;
  font-size: 13px;
  font-weight: var(--w-regular);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 18px 38px;
}

.bf-q-head {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  column-gap: 14px;
  align-items: start;
}

.bf-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  padding: 0 5px;
  margin-top: 0.28em;
  border-radius: 4px;
  background: var(--accent);
  color: var(--text);
  font-size: 12px;
  font-weight: var(--w-bold);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.bf-title {
  font-size: clamp(22px, 2.6vw, 32px);
  font-weight: var(--w-bold);
  line-height: 1.22;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

.bf-title:focus {
  outline: none;
}

.bf-req {
  color: var(--accent-text);
  margin-left: 2px;
}

.bf-help {
  grid-column: 2;
  margin-top: 12px;
  max-width: 62ch;
  font-size: 17px;
  font-weight: var(--w-thin);
  line-height: 1.5;
  color: var(--muted);
  text-wrap: pretty;
}

.bf-body {
  margin-top: 34px;
  padding-left: 38px;
}

/* --- Campos de texto: só a linha inferior --- */
.bf-input,
.bf-textarea {
  display: block;
  width: 100%;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  padding: 6px 0 12px;
  font-size: clamp(20px, 2.2vw, 26px);
  font-weight: var(--w-regular);
  line-height: 1.35;
  caret-color: var(--accent);
  transition: border-color 0.3s ease;
}

.bf-textarea {
  resize: none;
  overflow: hidden;
  min-height: 48px;
}

.bf-input::placeholder,
.bf-textarea::placeholder {
  color: var(--faint);
  font-weight: var(--w-thin);
}

.bf-input:focus,
.bf-textarea:focus {
  outline: none;
  border-bottom-color: var(--accent);
}

.bf-input.is-small {
  font-size: 19px;
}

/* --- Opções --- */
.bf-options {
  display: grid;
  gap: 8px;
  max-width: 560px;
}

.bf-options.is-wide {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-width: none;
}

.bf-option {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 50px;
  padding: 10px 14px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface);
  font-size: 17px;
  font-weight: var(--w-regular);
  line-height: 1.3;
  transition: border-color 0.25s ease, background-color 0.25s ease;
}

.bf-option:hover {
  border-color: rgba(242, 234, 223, 0.5);
  background: rgba(242, 234, 223, 0.07);
}

.bf-key {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: 12px;
  font-weight: var(--w-bold);
  transition: background-color 0.25s ease, border-color 0.25s ease;
}

.bf-option-label {
  flex: 1;
}

.bf-check {
  flex: none;
  width: 16px;
  height: 16px;
  opacity: 0;
  color: var(--accent-text);
  transition: opacity 0.2s ease;
}

.bf-option[aria-pressed="true"],
.bf-option[aria-checked="true"] {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.bf-option[aria-pressed="true"] .bf-key,
.bf-option[aria-checked="true"] .bf-key {
  background: var(--accent);
  border-color: var(--accent);
}

.bf-option[aria-pressed="true"] .bf-check,
.bf-option[aria-checked="true"] .bf-check {
  opacity: 1;
}

.bf-option.is-blocked {
  animation: bf-shake 0.35s ease;
}

@keyframes bf-shake {
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

/* Palavras em formato de etiqueta */
.bf-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.bf-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  font-size: 16px;
  font-weight: var(--w-regular);
  transition: border-color 0.25s ease, background-color 0.25s ease;
}

.bf-chip:hover {
  border-color: rgba(242, 234, 223, 0.5);
}

.bf-chip[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.bf-chip-order {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent);
  font-size: 11px;
  font-weight: var(--w-bold);
}

/* Blocos extras abaixo das opções */
.bf-sub {
  margin-top: 28px;
  max-width: 560px;
}

.bf-sub-label {
  display: block;
  font-size: 15px;
  font-weight: var(--w-regular);
  color: var(--muted);
  margin-bottom: 10px;
}

.bf-note {
  font-size: 15px;
  font-weight: var(--w-thin);
  color: var(--muted);
  margin-top: 14px;
}

/* Vários campos na mesma tela */
.bf-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 26px 32px;
}

.bf-field label {
  display: block;
  font-size: 14px;
  font-weight: var(--w-regular);
  color: var(--muted);
  margin-bottom: 4px;
}

/* --- Ações --- */
.bf-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 18px;
  margin-top: 34px;
}

.bf-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 0 20px;
  border-radius: 5px;
  background: var(--accent);
  color: var(--text);
  font-size: 16px;
  font-weight: var(--w-bold);
  letter-spacing: 0.01em;
  text-decoration: none;
  transition: background-color 0.25s ease, opacity 0.25s ease;
}

.bf-btn:hover {
  background: var(--accent-hover);
}

.bf-btn[disabled] {
  opacity: 0.5;
  cursor: progress;
}

.bf-hint {
  font-size: 14px;
  font-weight: var(--w-thin);
  color: var(--muted);
}

.bf-hint kbd {
  font-family: inherit;
  font-weight: var(--w-bold);
}

.bf-error {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin-top: 16px;
  font-size: 15px;
  font-weight: var(--w-regular);
  line-height: 1.4;
  color: var(--accent-text);
}

.bf-error:empty {
  display: none;
}

/* --- Telas de abertura, metade e encerramento --- */
.bf-screen {
  text-align: center;
  max-width: 640px;
}

.bf-eyebrow {
  display: block;
  font-size: 13px;
  font-weight: var(--w-regular);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-text);
  margin-bottom: 18px;
}

.bf-screen h1,
.bf-screen h2 {
  font-size: clamp(28px, 4vw, 44px);
  font-weight: var(--w-bold);
  line-height: 1.1;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.bf-screen p {
  margin-top: 18px;
  font-size: 18px;
  font-weight: var(--w-thin);
  line-height: 1.55;
  color: var(--muted);
  text-wrap: pretty;
}

.bf-screen p + p {
  margin-top: 12px;
}

.bf-screen .bf-actions {
  justify-content: center;
}

.bf-mid-bar {
  width: 180px;
  height: 3px;
  margin: 0 auto 30px;
  background: rgba(214, 65, 9, 0.2);
  position: relative;
}

.bf-mid-bar::after {
  content: "";
  position: absolute;
  inset: 0 50% 0 0;
  background: var(--accent);
}

/* --- Contato e consentimento --- */
.bf-contact {
  display: grid;
  gap: 26px;
  max-width: 560px;
}

.bf-consent {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-top: 30px;
  max-width: 560px;
  cursor: pointer;
  font-size: 15px;
  font-weight: var(--w-thin);
  line-height: 1.5;
  color: var(--muted);
}

.bf-consent input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.bf-consent-box {
  flex: none;
  width: 20px;
  height: 20px;
  margin-top: 1px;
  border: 1.5px solid var(--line);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.bf-consent-box svg {
  opacity: 0;
}

.bf-consent input:checked + .bf-consent-box {
  background: var(--accent);
  border-color: var(--accent);
}

.bf-consent input:checked + .bf-consent-box svg {
  opacity: 1;
}

.bf-consent input:focus-visible + .bf-consent-box {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.bf-consent a {
  color: var(--text);
  font-weight: var(--w-regular);
}

/* --- Navegação por setas --- */
.bf-nav {
  position: fixed;
  right: var(--gutter);
  bottom: 22px;
  display: flex;
  gap: 4px;
  z-index: 15;
}

.bf-nav-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 34px;
  border-radius: 5px;
  background: var(--accent-soft);
  color: var(--text);
  transition: background-color 0.25s ease, opacity 0.25s ease;
}

.bf-nav-btn:hover {
  background: rgba(214, 65, 9, 0.32);
}

.bf-nav-btn.is-next {
  background: var(--accent);
}

.bf-nav-btn.is-next:hover {
  background: var(--accent-hover);
}

.bf-nav-btn[disabled] {
  opacity: 0.3;
  cursor: default;
  pointer-events: none;
}

.bf-nav[hidden] {
  display: none;
}

.bf-foot {
  position: fixed;
  left: var(--gutter);
  bottom: 30px;
  z-index: 14;
  font-size: 11px;
  font-weight: var(--w-bold);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--faint);
}

/* --- Celular --- */
@media (max-width: 720px) {
  .bf-logo {
    margin: -26px 0 -26px -22px;
  }

  .bf-logo img {
    height: 100px;
  }

  /* Faixa escura atrás das setas para o conteúdo não brigar com elas ao rolar */
  body::after {
    content: "";
    position: fixed;
    inset: auto 0 0 0;
    height: 84px;
    background: linear-gradient(0deg, var(--bg) 45%, rgba(6, 6, 6, 0));
    pointer-events: none;
    z-index: 14;
  }

  .bf-options {
    gap: 6px;
  }

  .bf-option {
    min-height: 44px;
    padding: 8px 12px;
  }

  .bf-stage {
    padding: 88px var(--gutter) 104px;
  }

  .bf-section {
    margin-left: 0;
  }

  .bf-q-head {
    grid-template-columns: 22px minmax(0, 1fr);
    column-gap: 10px;
  }

  .bf-num {
    min-width: 22px;
    height: 22px;
    font-size: 11px;
  }

  .bf-help {
    grid-column: 1 / -1;
    font-size: 16px;
  }

  .bf-body {
    padding-left: 0;
    margin-top: 26px;
  }

  .bf-options.is-wide,
  .bf-fields {
    grid-template-columns: minmax(0, 1fr);
  }

  .bf-option {
    font-size: 16px;
  }

  .bf-key {
    width: 22px;
    height: 22px;
  }

  .bf-chip {
    font-size: 15px;
    padding: 8px 13px;
  }

  .bf-hint {
    display: none;
  }

  .bf-foot {
    display: none;
  }

  .bf-screen p {
    font-size: 17px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .bf-step,
  .bf-progress-fill {
    transition: none;
  }

  .bf-step.is-entering,
  .bf-step.is-leaving {
    transform: none;
  }

  .bf-option.is-blocked {
    animation: none;
  }
}
