/* Formulario de análisis en las landings, brazo del A/B (services/landing_ab.py).
   Fichero propio para que el brazo de control no lo descargue. El buscador es el
   `.lt-search` del sistema, sobre la misma caja oscura que `.lt-listing-cta`. */

.lp-form {
  background: var(--lt-ink);
  border-radius: var(--lt-r-xl);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: var(--lt-s-5);
  min-width: 0;
}
.lp-form__texto { display: flex; flex-direction: column; gap: var(--lt-s-3); }
.lt-listing-cta__h.lp-form__h { line-height: 1.3; }
.lp-form .lp-form__search { width: 100%; max-width: none; margin: 0; }
.lp-form .lp-form__search .lt-btn { white-space: nowrap; }
/* En la caja estrecha el aviso de adjuntos partía en dos líneas y dejaba el botón a
   medias. Los adjuntos se ofrecen igual en el modal y en el compositor de móvil. */
.lp-form:not(.lp-form--banda) .lt-search__hint { display: none; }
.lp-form:not(.lp-form--banda) .lt-search__foot { display: block; padding: 0; }
.lp-form:not(.lp-form--banda) .lt-search__foot .lt-btn { display: flex; width: 100%; justify-content: center; }
.lp-form__error {
  margin: 0;
  padding: 0 16px;
  font-size: 13px;
  line-height: 1.4;
  font-weight: 600;
  color: #b42318;
}

/* Dentro de la banda de la landing editorial: mismo ancho que `.lp-ed-cta`. */
.lp-form--banda {
  width: calc(100% - var(--lt-gutter) * 2);
  max-width: calc(var(--lt-container) - var(--lt-gutter) * 2);
  margin: var(--lt-s-13) auto;
  flex-direction: row;
  align-items: center;
  gap: var(--lt-s-10);
  padding: var(--lt-s-10) var(--lt-s-11);
  border-radius: var(--lt-r-lg);
}
.lp-form--banda .lp-form__texto { flex: 1 1 340px; }
.lp-form--banda .lp-form__search { flex: 1 1 440px; }

/* El compositor a pantalla completa de la portada (home-composer.js). Estas reglas
   viven en page-home.css, que la landing no carga: se copian solo las necesarias. */
.home-composer__bar { display: none; }

@media (max-width: 768px) {
  /* Cada píxel aquí baja la lista de abogados: 4 de relleno, 2 de hueco y 6 de botón. */
  .lp-form { padding: 12px; border-radius: var(--lt-r-lg); gap: 10px; }
  .lp-form__lead { display: none; }
  .lt-listing-cta__h.lp-form__h { font-size: 16px; }
  .lp-form .lt-search:not(.is-composing) .lt-btn { padding: 11px; }
  .lp-form__error { padding: 0 12px; }
  .lt-search.is-composing .lp-form__error { padding: 0 2px; }

  .lp-form--banda {
    flex-direction: column;
    align-items: stretch;
    margin: var(--lt-s-10) auto;
    padding: 12px;
  }
  .lp-form--banda .lp-form__texto,
  .lp-form--banda .lp-form__search { flex: none; }

  .home-composer__bar {
    align-items: center;
    gap: 10px;
    padding: 2px 2px 10px 2px;
    border-bottom: 1px solid var(--lt-divider);
    margin-bottom: 10px;
    flex-shrink: 0;
  }
  .lt-search.is-composing .home-composer__bar { display: flex; }

  button.home-composer__close {
    width: 34px;
    height: 34px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--lt-canvas);
    border: none;
    border-radius: var(--lt-r-ctl-sm);
    color: var(--lt-text-2);
    cursor: pointer;
  }
  .home-composer__title {
    flex: 1;
    min-width: 0;
    font-family: var(--lt-font-head);
    font-weight: 600;
    font-size: 15px;
    color: var(--lt-ink);
  }
  .home-composer__count {
    font-size: 12px;
    font-weight: 600;
    color: var(--lt-text-muted);
    flex-shrink: 0;
  }

  .lp-form .lt-search.is-composing {
    position: fixed;
    left: 0;
    right: 0;
    top: 0;
    z-index: 60;                       /* por encima del header (50) */
    margin: 0;
    width: 100%;
    max-width: none;
    border-radius: 0;
    box-shadow: none;
    background: var(--lt-surface);
    padding: 14px 16px calc(14px + env(safe-area-inset-bottom)) 16px;
    display: flex;
    flex-direction: column;
  }
  .lt-search.is-composing .lt-search__input {
    flex: 1;
    height: auto;
    min-height: 0;
    max-height: none;
    font-size: 16px;                   /* < 16px y iOS hace zoom al enfocar */
    line-height: 1.5;
    padding: 4px 2px;
    resize: none;
  }
  .lt-search.is-composing .lt-search__foot {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding-top: 10px;
    border-top: 1px solid var(--lt-divider);
  }
  .lt-search.is-composing .lt-search__hint {
    display: block;
    text-align: center;
    font-size: 12px;
  }
  .lt-search.is-composing .lt-search__foot .lt-btn {
    width: 100%;
    justify-content: center;
    padding: 15px;
    font-size: 15px;
  }
  body.is-composing { overflow: hidden; }
}
