/* ==========================================================================
   VERSUS — Brief de descubrimiento de marca
   Se carga después de system.css (tokens --vs-*, tipografías, revelado) y
   pages.css (wrap, section, label, btn, badge, plus/minus). Aquí solo viven
   los componentes propios de esta página: cabecera simple, barra de
   progreso, panel de secciones, campos de formulario, chips y adjuntos.
   ========================================================================== */

* { box-sizing: border-box; }

/* ------------------------------------------------------- barra de avance --- */

.bf-topline {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 2px;
  background: rgba(39, 51, 40, 0.1);
  z-index: 100;
}
.bf-topline__bar {
  height: 100%; width: 0%;
  background: var(--vs-green);
  transition: width 0.12s linear;
}

/* ------------------------------------------------------------ cabecera --- */

.bf-header {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(56px, 14vw, 100px) var(--vs-gutter) 18px;
}
.bf-header__logo { display: block; height: 17px; width: auto; }

/* ------------------------------------------------------------------ hero --- */

.bf-hero { padding: clamp(38px, 6vw, 78px) 0 clamp(48px, 8vw, 96px); text-align: center; }
.bf-hero .badge { margin: 0 auto 26px; }
.bf-hero h1 { font-size: clamp(30px, 4.6vw, 56px); line-height: 1.1; color: var(--vs-ink); }
.bf-br-m { display: none; }
.bf-hero__sub {
  max-width: 560px;
  margin: 18px auto 0;
  font-size: clamp(13px, 1vw, 14.5px);
  line-height: 1.6;
}

.bf-meta-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin: clamp(26px, 3vw, 36px) 0 0;
}
.bf-meta-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 20px;
  background: #fff;
  font-size: 12.5px;
  color: var(--vs-ink);
}
.bf-meta-chip svg { width: 14px; height: 14px; flex: none; color: var(--vs-accent); }

/* ---- tarjetas plegables (idéntico a branding-mr-tenders: dash-card/scope-card) --- */

.bf-collapse-row {
  max-width: 900px;
  margin: clamp(26px, 3vw, 36px) auto 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  align-items: start;
  text-align: left;
}
.bf-scope-card {
  margin: 0;
  background: #fff;
  border-radius: var(--vs-r-card);
}
.bf-scope-card--blue { background: var(--vs-blue); }

.bf-scope-card > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: clamp(20px, 2.4vw, 26px) clamp(22px, 2.6vw, 30px);
  border-radius: var(--vs-r-card);
}
.bf-scope-card > summary::-webkit-details-marker { display: none; }

.bf-scope__title {
  margin: 0;
  font-family: var(--vs-text);
  font-weight: 500;
  font-size: 11px;
  line-height: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--vs-ink);
}
.bf-scope-card > summary::after {
  content: "+";
  flex: none;
  font-size: 16px;
  line-height: 1;
  color: var(--vs-ink);
}
.bf-scope-card[open] > summary::after { content: "\2212"; }

.bf-scope-card > p, .bf-scope-card > ul {
  margin: 0;
  padding: 0 clamp(22px, 2.6vw, 30px) clamp(20px, 2.4vw, 26px);
  font-size: 13px;
  line-height: 1.6;
  color: var(--vs-ink);
  list-style: none;
}
.bf-scope-card li {
  position: relative;
  padding-left: 16px;
}
.bf-scope-card li + li { margin-top: 12px; }
.bf-scope-card li::before {
  content: "";
  position: absolute;
  left: 0; top: 9px;
  width: 8px; height: 1px;
  background: currentColor;
}

/* --------------------------------------------------- riel de progreso ----- */

.bf-rail {
  position: fixed;
  right: 26px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 80;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 16px;
}
.bf-rail__track {
  position: absolute;
  right: 4px; top: 4px; bottom: 4px;
  width: 1px;
  background: var(--vs-line);
  z-index: -1;
}
.bf-rail__item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}
.bf-rail__label {
  font-family: var(--vs-text);
  font-weight: 500;
  font-size: 8.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--vs-ink);
  background: #fff;
  padding: 6px 12px;
  border-radius: 12px;
  white-space: nowrap;
  opacity: 0;
  transform: translateX(6px);
  transition: opacity 0.22s ease, transform 0.22s ease;
  pointer-events: none;
}
.bf-rail__item:hover .bf-rail__label,
.bf-rail__item.is-active .bf-rail__label { opacity: 1; transform: none; }
.bf-rail__dot {
  flex: none;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: #fff;
  box-shadow: inset 0 0 0 0.5px var(--vs-sand);
  transition: background-color 0.22s ease, box-shadow 0.22s ease, transform 0.22s ease;
}
.bf-rail__item.is-active .bf-rail__dot {
  background: var(--vs-green);
  box-shadow: inset 0 0 0 0.5px var(--vs-green);
  transform: scale(1.25);
}
.bf-rail__item.is-done .bf-rail__dot { box-shadow: inset 0 0 0 0.5px var(--vs-green); }

/* ------------------------------------------------------------ formulario --- */

.bf-form { display: flex; flex-direction: column; gap: clamp(18px, 2.4vw, 24px); }

.bf-panel {
  background: #fff;
  border-radius: var(--vs-r-card-lg);
  padding: clamp(30px, 4vw, 56px);
  scroll-margin-top: 90px;
}
.bf-panel__head { display: flex; align-items: flex-end; gap: 20px; flex-wrap: wrap; }
.bf-panel__n {
  font-family: var(--vs-display);
  font-weight: 100;
  font-size: 50px;
  line-height: 1;
  color: var(--vs-sand);
}
.bf-panel__head h2 { font-size: clamp(23px, 2.3vw, 33px); }
.bf-panel__desc { color: var(--vs-muted); font-size: 13.5px; max-width: 640px; margin: 16px 0 0; }
.bf-panel__note {
  margin: 18px 0 0;
  padding: 14px 18px;
  border-radius: 16px;
  background: var(--vs-bg);
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--vs-muted);
}
.bf-panel__rule { height: 0.5px; background: var(--vs-line); margin: 28px 0 30px; }

.bf-group + .bf-group { margin-top: clamp(24px, 2.8vw, 32px); }

/* ---- campos ---- */

.bf-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.bf-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.bf-field--full { grid-column: 1 / -1; }

.bf-field { display: flex; flex-direction: column; gap: 9px; }
.bf-field label, .bf-label {
  display: block;
  font-family: var(--vs-text);
  font-weight: 500;
  font-size: 11.5px;
  color: var(--vs-ink);
  line-height: 1.4;
}
.bf-req { color: var(--vs-accent); }
.bf-hint {
  display: block;
  margin-top: 2px;
  font-weight: 300;
  letter-spacing: 0;
  font-size: 12.5px;
  color: var(--vs-muted);
}

/* toda pregunta de botones (radio/checkbox en chip) comparte el mismo
   envoltorio .bf-field: el espaciado entre etiqueta y chips lo da siempre
   el gap del flex, nunca un margin-top puntual por pregunta. */
.bf-field > .bf-chips, .bf-field > .bf-yesno { margin: 0; }

.bf-input, .bf-textarea {
  width: 100%;
  border: none;
  border-radius: 16px;
  background: #f8f8f8;
  padding: 13px 16px;
  font-family: var(--vs-text);
  font-weight: 300;
  font-size: 13px;
  color: var(--vs-ink);
  transition: border-color 0.2s ease, background-color 0.2s ease;
}
.bf-textarea { resize: vertical; min-height: 98px; line-height: 1.55; }
.bf-input:focus, .bf-textarea:focus { outline: none; box-shadow: 0 0 0 1px var(--vs-ink); background: #fff; }
.bf-input::placeholder, .bf-textarea::placeholder { color: var(--vs-muted); }

/* ---- chips (radio / checkbox) ---- */

.bf-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.bf-chip { position: relative; display: inline-flex; }
.bf-chip input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.bf-chip span {
  display: inline-flex;
  align-items: center;
  padding: 9px 17px;
  border-radius: 20px;
  background: none;
  border: 1px solid var(--vs-line);
  font-weight: 300;
  font-size: 12px;
  line-height: 1.2;
  color: var(--vs-ink);
  cursor: pointer;
  transition: background-color 0.22s var(--vs-ease), border-color 0.22s var(--vs-ease),
    color 0.22s var(--vs-ease), transform 0.22s var(--vs-ease);
  user-select: none;
}
.bf-chip:hover span { border-color: var(--vs-ink); }
.bf-chip input:checked + span { background: var(--vs-dark); border-color: var(--vs-dark); color: #fff; }
.bf-chip input:focus-visible + span { outline: 2px solid var(--vs-accent); outline-offset: 3px; }

.bf-chip-other {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.32s var(--vs-ease);
}
.bf-chip-other.is-open { grid-template-rows: 1fr; margin-top: 12px; }
.bf-chip-other > div { overflow: hidden; }

/* ---- sí / no ---- */

.bf-yesno { display: inline-flex; gap: 6px; padding: 5px; border-radius: 22px; background: none; border: 1px solid var(--vs-line); }
.bf-yesno .bf-chip span { background: none; border: 0; padding: 9px 22px; border-radius: 17px; }
.bf-yesno .bf-chip input:checked + span { background: var(--vs-dark); color: #fff; }

/* ---- revelado condicional ---- */

.bf-reveal {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.35s var(--vs-ease);
}
.bf-reveal.is-open { grid-template-rows: 1fr; margin-top: 16px; }
.bf-reveal > div { overflow: hidden; }

/* ---- comparativa a dos columnas (Q18) ---- */

.bf-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.bf-compare .bf-field label { color: var(--vs-accent); }

/* ---- lista repetible (competidores) ---- */

.bf-repeater { display: flex; flex-direction: column; gap: 10px; }
.bf-repeater__row { display: flex; align-items: center; gap: 10px; }
.bf-repeater__n {
  flex: none;
  width: 22px;
  font-family: var(--vs-text);
  font-size: 12px;
  color: var(--vs-muted);
  text-align: right;
}
.bf-repeater__row .bf-input { flex: 1; }
.bf-repeater__remove {
  flex: none;
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 1px solid var(--vs-line);
  background: none;
  color: var(--vs-muted);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease, background-color 0.2s ease;
}
.bf-repeater__remove:hover { border-color: var(--vs-ink); color: var(--vs-ink); background: var(--vs-bg); }
.bf-repeater__add {
  align-self: flex-start;
  margin-top: 4px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px 10px 14px;
  border-radius: 20px;
  border: 1px dashed var(--vs-line);
  background: none;
  font-family: var(--vs-text);
  font-size: 13px;
  color: var(--vs-ink);
  cursor: pointer;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}
.bf-repeater__add:hover { border-color: var(--vs-ink); border-style: solid; background: var(--vs-bg); }
.bf-repeater__add svg { width: 12px; height: 12px; }

/* ---- adjuntos ---- */

.bf-drop {
  border: 1.5px dashed var(--vs-line);
  border-radius: 20px;
  padding: 28px 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}
.bf-drop:hover, .bf-drop.is-drag { border-color: var(--vs-ink); background: rgba(207, 198, 184, 0.16); }
.bf-drop input { display: none; }
.bf-drop svg { width: 22px; height: 22px; margin: 0 auto 10px; color: var(--vs-accent); }
.bf-drop p { margin: 0; font-size: 13.5px; color: var(--vs-ink); }
.bf-drop span { font-size: 12px; color: var(--vs-muted); }

.bf-drop-error { margin: 10px 0 0; font-size: 12px; color: #b23b3b; }

.bf-preview { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.bf-preview__item { position: relative; width: 78px; height: 78px; border-radius: 12px; overflow: hidden; background: var(--vs-bg); }
.bf-preview__item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bf-preview__item button {
  position: absolute;
  top: 4px; right: 4px;
  width: 20px; height: 20px;
  border-radius: 50%;
  border: 0;
  background: rgba(32, 35, 23, 0.72);
  color: #fff;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
}

/* -------------------------------------------------------- estado guardado --- */

.bf-save-status {
  position: fixed;
  left: 22px; bottom: 22px;
  z-index: 85;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 11px 18px;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(32, 35, 23, 0.12);
  font-family: var(--vs-text);
  font-size: 12.5px;
  color: var(--vs-muted);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
}
.bf-save-status.is-visible { opacity: 1; transform: none; }
.bf-save-status b { width: 6px; height: 6px; border-radius: 50%; background: var(--vs-green); flex: none; }

/* -------------------------------------------------------------- envío ------ */

.bf-submit-panel { text-align: center; }
.bf-submit-panel h2 { font-size: clamp(26px, 3vw, 38px); margin-bottom: 14px; }
.bf-submit-panel p { max-width: 560px; margin: 0 auto 26px; color: var(--vs-muted); font-size: 14px; }
.bf-submit-panel .btn { min-width: 240px; }

.bf-result { display: none; }
.bf-result.is-visible { display: block; }
.bf-result__fallback { display: none; }
.bf-result.is-fallback .bf-result__ok { display: none; }
.bf-result.is-fallback .bf-result__fallback { display: block; }
.bf-result__icon {
  width: 58px; height: 58px;
  margin: 0 auto 22px;
  border-radius: 50%;
  background: var(--vs-blue);
  display: flex;
  align-items: center;
  justify-content: center;
}
.bf-result__icon svg { width: 22px; height: 22px; color: var(--vs-green); }
.bf-result .btn-row { justify-content: center; margin-top: 6px; }

.bf-summary-wrap { max-width: 560px; margin: 22px auto 0; text-align: left; }
.bf-summary-wrap label { display: block; margin-bottom: 8px; }
.bf-summary {
  width: 100%;
  min-height: 140px;
  border: 1px solid var(--vs-line);
  border-radius: 16px;
  background: var(--vs-bg);
  padding: 14px 16px;
  font-family: var(--vs-text);
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--vs-muted);
  resize: vertical;
}

.bf-form.is-sent .bf-submit-fields { display: none; }

/* ------------------------------------------------------------------ pie --- */

.bf-footer {
  padding: clamp(50px, 6vw, 84px) 0 clamp(30px, 4vw, 46px);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.bf-footer__brand { display: flex; align-items: center; gap: 14px; }
.bf-footer__brand img { height: 15px; width: auto; }
.bf-footer__contact { display: flex; flex-wrap: wrap; gap: 18px; font-size: 12.5px; }
.bf-footer__contact a { text-decoration: underline 1px transparent; text-underline-offset: 4px; transition: text-decoration-color 0.22s ease; }
.bf-footer__contact a:hover { text-decoration-color: currentColor; }

/* ------------------------------------------------------------ responsive --- */

@media (max-width: 1080px) {
  .bf-rail { display: none; }
}
@media (max-width: 860px) {
  .bf-grid, .bf-grid--3, .bf-compare { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .bf-collapse-row { grid-template-columns: 1fr; max-width: 560px; gap: 10px; }
}
@media (max-width: 640px) {
  .bf-header { padding-left: 20px; padding-right: 20px; }
  .bf-hero h1 { font-size: 40px; }
  .bf-br-m { display: inline; }
  .bf-br-d { display: none; }
  .bf-panel { padding: 26px 22px; border-radius: 30px; }
  .bf-panel__head { flex-direction: column; align-items: flex-start; gap: 6px; }
  .bf-save-status { left: 14px; bottom: 14px; padding: 9px 14px; font-size: 11.5px; }
  .bf-footer { padding-top: 20px; justify-content: center; text-align: center; }
}
