/*
 * test-lead.css — Estilos de la página de pruebas de captura de leads
 * Kinik Labs · test-lead.html (spec lead-capture-01)
 * Se apoya en el design system del sitio (tokens/reset/base). Este archivo
 * solo define los componentes específicos de la página de prueba.
 */

/* ─────────────────────────────────────────────
   Hero de la página de pruebas
   ───────────────────────────────────────────── */
.lead-hero {
  text-align: center;
}

.lead-hero__title {
  font-family: var(--font-heading);
  font-size: var(--text-5xl);
  font-weight: var(--font-weight-bold);
  color: var(--text-primary);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  margin-bottom: var(--space-4);
}

.lead-hero__description {
  max-width: 60ch;
  margin-inline: auto;
  font-size: var(--text-lg);
  color: var(--text-secondary);
  line-height: var(--leading-normal);
}

/* ─────────────────────────────────────────────
   Elección inicial (RF-019): chat vs formulario
   ───────────────────────────────────────────── */
.lead-choice__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-6);
  max-width: var(--container-lg);
  margin-inline: auto;
}

.lead-choice__card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-4);
  text-align: left;
  padding: var(--space-8);
  border: var(--border-thin) solid var(--border-color);
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  box-shadow: var(--shadow-surface);
  cursor: pointer;
  font-family: var(--font-body);
  color: var(--text-primary);
  transition:
    transform var(--duration-normal) var(--ease-spring),
    box-shadow var(--duration-normal) var(--ease-default),
    border-color var(--duration-normal) var(--ease-default);
}

.lead-choice__card:hover,
.lead-choice__card:focus-visible {
  transform: translateY(-3px);
  box-shadow: var(--shadow-elevated);
  border-color: var(--interactive-secondary);
  outline: none;
}

.lead-choice__card:focus-visible {
  outline: 2px solid var(--border-color-focus);
  outline-offset: 3px;
}

.lead-choice__icon {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  border-radius: var(--radius-lg);
  background: var(--color-brand-gradient);
  color: var(--color-neutral-0);
  box-shadow: var(--shadow-brand);
}

.lead-choice__title {
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  font-weight: var(--font-weight-semibold);
  letter-spacing: var(--tracking-tight);
}

.lead-choice__desc {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: var(--leading-normal);
}

/* ─────────────────────────────────────────────
   Chat página completa (RF-020..023)
   ───────────────────────────────────────────── */
.chat-panel {
  border: var(--border-thin) solid var(--border-color);
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  box-shadow: var(--shadow-elevated);
  overflow: hidden;
}

.chat-panel .chat-widget__messages {
  min-height: 340px;
  max-height: 56vh;
}

.chat-panel__toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
  padding: var(--space-3) var(--space-4);
  border-top: var(--border-thin) solid var(--border-color);
}

.chat-panel__hint {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  line-height: var(--leading-normal);
}

/* ─────────────────────────────────────────────
   Formulario storytelling (RF-024..027)
   ───────────────────────────────────────────── */
.story-form {
  background: var(--bg-surface);
  border: var(--border-thin) solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-elevated);
  padding: var(--space-8);
}

.story-form__progress {
  height: 6px;
  border-radius: var(--radius-full);
  background: var(--bg-subtle);
  overflow: hidden;
  margin-bottom: var(--space-8);
}

.story-form__bar {
  height: 100%;
  width: 0%;
  border-radius: var(--radius-full);
  background: var(--color-brand-gradient);
  transition: width var(--duration-normal) var(--ease-default);
}

.story-form__counter {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  margin-bottom: var(--space-2);
}

.story-form__slide {
  display: none;
}

.story-form__slide.is-active {
  display: block;
  animation: story-slide-in var(--duration-normal) var(--ease-out);
}

@keyframes story-slide-in {
  from {
    opacity: 0;
    transform: translateX(12px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.story-form__question {
  font-family: var(--font-heading);
  font-size: var(--text-2xl);
  font-weight: var(--font-weight-semibold);
  letter-spacing: var(--tracking-tight);
  color: var(--text-primary);
  margin-bottom: var(--space-6);
}

.story-form__nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-4);
  margin-top: var(--space-8);
}

.story-form__error {
  margin-top: var(--space-3);
  font-size: var(--text-sm);
  color: var(--color-error);
}

.story-form__summary {
  display: grid;
  gap: var(--space-3);
  background: var(--bg-subtle);
  border: var(--border-thin) solid var(--border-color);
  border-radius: var(--radius-md);
  padding: var(--space-6);
}

.story-form__summary-item {
  display: flex;
  justify-content: space-between;
  gap: var(--space-4);
  font-size: var(--text-sm);
}

.story-form__summary-label {
  color: var(--text-tertiary);
  flex-shrink: 0;
}

.story-form__summary-value {
  color: var(--text-primary);
  font-weight: var(--font-weight-medium);
  text-align: right;
  word-break: break-word;
}

/* ─────────────────────────────────────────────
   Modal de confirmación del chat
   ───────────────────────────────────────────── */
.modal {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
  background: rgba(6, 13, 22, 0.6);
}

.modal[hidden] {
  display: none;
}

.modal__dialog {
  width: 100%;
  max-width: 560px;
  max-height: 90dvh;
  overflow-y: auto;
  background: var(--bg-surface);
  border: var(--border-thin) solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  padding: var(--space-8);
}

.modal__title {
  font-family: var(--font-heading);
  font-size: var(--text-2xl);
  font-weight: var(--font-weight-bold);
  letter-spacing: var(--tracking-tight);
  color: var(--text-primary);
  margin-bottom: var(--space-2);
}

.modal__desc {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: var(--leading-normal);
  margin-bottom: var(--space-6);
}

.modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-4);
  flex-wrap: wrap;
  margin-top: var(--space-6);
}

.modal__status {
  margin-top: var(--space-6);
}

/* ─────────────────────────────────────────────
   Globo tech v2 → movido a css/tech-globe.css
   (compartido con servicios.html)
   ───────────────────────────────────────────── */

/* Selector de país + número en el paso de teléfono */
.story-form__row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--space-3);
  align-items: stretch;
}

.story-form__row .form__select.story-form__code {
  width: auto;
  min-width: 108px;
}

/* ─────────────────────────────────────────────
   Responsive
   ───────────────────────────────────────────── */
@media (max-width: 640px) {
  .story-form {
    padding: var(--space-6);
  }
}

/* ─────────────────────────────────────────────
   Reduced motion
   ───────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .story-form__slide.is-active {
    animation: none;
  }

  .lead-choice__card,
  .story-form__bar {
    transition: none;
  }
}
