/* =====================================================================
   PanelSmart · Landing de reclutamiento — hoja de estilos v2
   ---------------------------------------------------------------------
   Reemplaza a Bootstrap 4 en la landing: layout con CSS Grid y un set
   acotado de componentes. Sólo se conserva jQuery + Select2 (buscador
   en los selects de ubicación, que llegan a >100 opciones).

   Prefijo .ps- en todo para no chocar con Select2 ni con el CSS viejo.
   ===================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

/* ---------- Tokens ---------- */
:root {
  --ps-brand:        #7cc100;   /* verde Kantar, se mantiene */
  --ps-brand-dark:   #6aa600;
  --ps-brand-soft:   #f2fae6;

  --ps-ink:          #0f172a;   /* texto principal  — contraste 16:1 */
  --ps-ink-soft:     #475569;   /* texto secundario — contraste 7:1  */
  --ps-ink-faint:    #64748b;   /* mínimo permitido — contraste 4.8:1 */

  --ps-line:         #e2e8f0;
  --ps-line-strong:  #cbd5e1;
  --ps-surface:      #ffffff;
  --ps-surface-alt:  #f8fafc;

  --ps-ok-bg:        #ecfdf5;  --ps-ok-ink:   #065f46;  --ps-ok-line:   #a7f3d0;
  --ps-warn-bg:      #fff7ed;  --ps-warn-ink: #9a3412;  --ps-warn-line: #fed7aa;
  --ps-info-bg:      #eff6ff;  --ps-info-ink: #1e40af;  --ps-info-line: #bfdbfe;
  --ps-err:          #dc2626;

  --ps-r-sm: 8px;
  --ps-r-md: 12px;
  --ps-r-lg: 20px;

  --ps-shadow:    0 1px 2px rgba(15,23,42,.04), 0 8px 24px rgba(15,23,42,.06);
  --ps-shadow-lg: 0 4px 6px rgba(15,23,42,.04), 0 24px 48px rgba(15,23,42,.10);

  --ps-tap: 48px;               /* alto mínimo de control táctil */
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: 'Poppins', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--ps-ink);
  background: var(--ps-surface-alt);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }

/* Foco visible y consistente en todo lo interactivo (a11y) */
:focus-visible {
  outline: 3px solid rgba(124,193,0,.45);
  outline-offset: 2px;
  border-radius: var(--ps-r-sm);
}

/* ---------- Layout de página ---------- */
.ps-page {
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(248,250,252,.92) 0%, rgba(248,250,252,.97) 60%, #f8fafc 100%),
    url(bg-kantar.jpg) center / cover no-repeat fixed;
  padding: 32px 16px 0;
}

.ps-wrap { width: 100%; max-width: 940px; margin: 0 auto; }

.ps-logo { max-width: 240px; margin: 0 auto 20px; }

.ps-banner {
  border-radius: var(--ps-r-lg);
  overflow: hidden;
  box-shadow: var(--ps-shadow);
  margin-bottom: 24px;
}

/* ---------- Tarjeta del formulario ---------- */
.ps-card {
  background: var(--ps-surface);
  border: 1px solid var(--ps-line);
  border-radius: var(--ps-r-lg);
  box-shadow: var(--ps-shadow-lg);
  padding: 32px;
}

.ps-card__head { margin-bottom: 24px; }

.ps-card__title {
  margin: 0 0 6px;
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -.02em;
  line-height: 1.25;
}

.ps-card__sub { margin: 0; font-size: 15px; color: var(--ps-ink-soft); }

/* ---------- Indicador de pasos ---------- */
.ps-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 28px;
  padding: 0;
  list-style: none;
}

.ps-step { min-width: 0; }

.ps-step__bar {
  height: 4px;
  border-radius: 999px;
  background: var(--ps-line);
  transition: background-color .25s ease;
}

.ps-step__txt {
  display: block;
  margin-top: 8px;
  font-size: 12px;
  font-weight: 500;
  color: var(--ps-ink-faint);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color .25s ease;
}

.ps-step__num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px; height: 18px;
  margin-right: 6px;
  border-radius: 50%;
  background: var(--ps-line);
  color: var(--ps-ink-faint);
  font-size: 11px;
  font-weight: 600;
  vertical-align: -3px;
  transition: background-color .25s ease, color .25s ease;
}

.ps-step.is-done .ps-step__bar,
.ps-step.is-active .ps-step__bar { background: var(--ps-brand); }

.ps-step.is-done .ps-step__txt,
.ps-step.is-active .ps-step__txt { color: var(--ps-ink); }

.ps-step.is-done .ps-step__num,
.ps-step.is-active .ps-step__num { background: var(--ps-brand); color: #fff; }

/* ---------- Bloques y campos ---------- */
.ps-panel { display: none; }
.ps-panel.is-active { display: block; animation: ps-in .28s ease both; }

@keyframes ps-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

.ps-section { margin-bottom: 28px; }
.ps-section:last-child { margin-bottom: 0; }

.ps-section__title {
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 600;
  color: var(--ps-ink);
}

.ps-section__hint {
  margin: 0 0 16px;
  font-size: 14px;
  color: var(--ps-ink-soft);
}

.ps-grid { display: grid; gap: 16px; }
.ps-grid--2 { grid-template-columns: repeat(2, 1fr); }
.ps-grid--3 { grid-template-columns: repeat(3, 1fr); }

.ps-field { display: flex; flex-direction: column; min-width: 0; }

/* Etiqueta siempre visible: nunca el placeholder como único rótulo */
.ps-label {
  margin-bottom: 6px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.35;
  color: var(--ps-ink);
}

.ps-label__opt { font-weight: 400; color: var(--ps-ink-faint); }

/* ---------- Controles ---------- */
.ps-input,
.ps-select {
  width: 100%;
  min-height: var(--ps-tap);
  padding: 12px 14px;
  /* 16px evita el zoom automático de iOS Safari al enfocar */
  font-family: inherit;
  font-size: 16px;
  line-height: 1.4;
  color: var(--ps-ink);
  background: var(--ps-surface);
  border: 1.5px solid var(--ps-line-strong);
  border-radius: var(--ps-r-md);
  transition: border-color .18s ease, box-shadow .18s ease, background-color .18s ease;
  appearance: none;
  -webkit-appearance: none;
}

.ps-input::placeholder { color: #94a3b8; }

.ps-select {
  padding-right: 42px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 18px;
  cursor: pointer;
}

.ps-input:hover:not(:disabled),
.ps-select:hover:not(:disabled) { border-color: #94a3b8; }

.ps-input:focus,
.ps-select:focus {
  outline: none;
  border-color: var(--ps-brand);
  box-shadow: 0 0 0 4px rgba(124,193,0,.18);
}

.ps-input:disabled,
.ps-select:disabled {
  background: var(--ps-surface-alt);
  color: #94a3b8;
  border-color: var(--ps-line);
  cursor: not-allowed;
}

/* Campo respondido: confirmación discreta, no sólo color */
.ps-select.is-filled { border-color: #bbdd7a; background-color: var(--ps-brand-soft); }

.ps-input.is-invalid,
.ps-select.is-invalid { border-color: var(--ps-err); }

.ps-error {
  display: none;
  margin-top: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ps-err);
}

.ps-field.has-error .ps-error { display: block; }

/* Teléfono con prefijo */
.ps-tel { display: flex; }

.ps-tel__pre {
  display: flex;
  align-items: center;
  padding: 0 14px;
  font-size: 16px;
  font-weight: 500;
  color: var(--ps-ink-soft);
  background: var(--ps-surface-alt);
  border: 1.5px solid var(--ps-line-strong);
  border-right: 0;
  border-radius: var(--ps-r-md) 0 0 var(--ps-r-md);
  white-space: nowrap;
}

.ps-tel .ps-input { border-radius: 0 var(--ps-r-md) var(--ps-r-md) 0; }
.ps-tel .ps-input:focus { position: relative; z-index: 1; }

/* ---------- Checkbox ---------- */
.ps-check {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-height: var(--ps-tap);
  padding: 10px 14px;
  background: var(--ps-surface-alt);
  border: 1.5px solid var(--ps-line);
  border-radius: var(--ps-r-md);
  cursor: pointer;
  transition: border-color .18s ease, background-color .18s ease;
}

.ps-check + .ps-check { margin-top: 10px; }
.ps-check:hover { border-color: var(--ps-line-strong); background: #fff; }

.ps-check input {
  flex: 0 0 auto;
  width: 22px; height: 22px;
  margin: 1px 0 0;
  accent-color: var(--ps-brand);
  cursor: pointer;
}

.ps-check__txt { font-size: 14px; line-height: 1.45; color: var(--ps-ink-soft); }
.ps-check__txt a { color: var(--ps-brand-dark); font-weight: 500; }

.ps-check:has(input:checked) {
  border-color: #bbdd7a;
  background: var(--ps-brand-soft);
}

/* ---------- Avisos ---------- */
.ps-alert {
  display: flex;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid;
  border-radius: var(--ps-r-md);
  font-size: 14px;
  line-height: 1.5;
}

.ps-alert svg { flex: 0 0 auto; width: 20px; height: 20px; margin-top: 1px; }

.ps-alert--ok   { background: var(--ps-ok-bg);   border-color: var(--ps-ok-line);   color: var(--ps-ok-ink); }
.ps-alert--warn { background: var(--ps-warn-bg); border-color: var(--ps-warn-line); color: var(--ps-warn-ink); }
.ps-alert--info { background: var(--ps-info-bg); border-color: var(--ps-info-line); color: var(--ps-info-ink); }

.ps-alert strong { font-weight: 600; }

/* ---------- Botones ---------- */
.ps-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--ps-line);
}

.ps-actions--end { justify-content: flex-end; }

.ps-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: var(--ps-tap);
  padding: 12px 28px;
  font-family: inherit;
  font-size: 16px;
  font-weight: 600;
  border: 1.5px solid transparent;
  border-radius: 999px;
  cursor: pointer;
  transition: background-color .18s ease, border-color .18s ease, color .18s ease, box-shadow .18s ease;
}

.ps-btn svg { width: 18px; height: 18px; }

.ps-btn--primary {
  color: #fff;
  background: var(--ps-brand);
  box-shadow: 0 2px 8px rgba(124,193,0,.32);
}

.ps-btn--primary:hover { background: var(--ps-brand-dark); box-shadow: 0 4px 14px rgba(124,193,0,.4); }

.ps-btn--ghost {
  color: var(--ps-ink-soft);
  background: transparent;
  border-color: var(--ps-line-strong);
}

.ps-btn--ghost:hover { color: var(--ps-ink); border-color: var(--ps-ink-soft); background: var(--ps-surface-alt); }

.ps-btn--block { width: 100%; }

.ps-btn:disabled,
.ps-btn.is-busy { opacity: .6; cursor: not-allowed; box-shadow: none; }

.ps-btn__spin { display: none; width: 18px; height: 18px; animation: ps-spin .8s linear infinite; }
.ps-btn.is-busy .ps-btn__spin { display: block; }

@keyframes ps-spin { to { transform: rotate(360deg); } }

.ps-grow { flex: 1; }

/* ---------- Select2 alineado a los controles propios ---------- */
.select2-container { width: 100% !important; }

.select2-container--default .select2-selection--single {
  height: var(--ps-tap);
  padding: 0 12px;
  background: var(--ps-surface);
  border: 1.5px solid var(--ps-line-strong);
  border-radius: var(--ps-r-md);
  transition: border-color .18s ease, box-shadow .18s ease;
}

.select2-container--default .select2-selection--single:hover { border-color: #94a3b8; }

.select2-container--default.select2-container--focus .select2-selection--single,
.select2-container--default.select2-container--open  .select2-selection--single {
  border-color: var(--ps-brand);
  box-shadow: 0 0 0 4px rgba(124,193,0,.18);
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
  padding: 0;
  font-size: 16px;
  line-height: calc(var(--ps-tap) - 3px);
  color: var(--ps-ink);
}

.select2-container--default .select2-selection--single .select2-selection__placeholder { color: #94a3b8; }

.select2-container--default .select2-selection--single .select2-selection__arrow {
  height: calc(var(--ps-tap) - 3px);
  right: 8px;
}

.select2-container--default.select2-container--disabled .select2-selection--single {
  background: var(--ps-surface-alt);
  border-color: var(--ps-line);
  cursor: not-allowed;
}

.select2-dropdown {
  border: 1.5px solid var(--ps-line-strong);
  border-radius: var(--ps-r-md);
  box-shadow: var(--ps-shadow);
  overflow: hidden;
}

.select2-container--default .select2-results__option {
  padding: 11px 14px;
  font-size: 15px;
}

.select2-container--default .select2-results__option--highlighted[aria-selected] {
  background: var(--ps-brand);
  color: #fff;
}

.select2-search--dropdown .select2-search__field {
  min-height: 42px;
  padding: 8px 12px;
  font-size: 16px;
  border: 1.5px solid var(--ps-line-strong);
  border-radius: var(--ps-r-sm);
}

/* Select2 marca el campo como respondido igual que un <select> propio */
.ps-sel2-filled + .select2-container .select2-selection--single {
  border-color: #bbdd7a;
  background-color: var(--ps-brand-soft);
}

/* ---------- Pasos "cómo funciona" ---------- */
.ps-how {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin: 40px 0;
}

.ps-how__item {
  display: flex;
  gap: 14px;
  padding: 20px;
  background: var(--ps-surface);
  border: 1px solid var(--ps-line);
  border-radius: var(--ps-r-md);
}

.ps-how__ico {
  flex: 0 0 auto;
  width: 44px; height: 44px;
  display: grid;
  place-items: center;
  background: var(--ps-brand-soft);
  border-radius: 12px;
  color: var(--ps-brand-dark);
}

.ps-how__ico svg { width: 22px; height: 22px; }
.ps-how__item p { margin: 0; font-size: 14px; line-height: 1.5; color: var(--ps-ink-soft); }

/* ---------- Pie ---------- */
.ps-foot { margin-top: 48px; background: #0f172a; }
.ps-foot__rule { height: 3px; background: linear-gradient(to right, #a37e2c, #e5d063, #a37e2c); }
.ps-foot p { margin: 0; padding: 22px 16px; font-size: 13px; color: #cbd5e1; text-align: center; }

.ps-sr {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .ps-how { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .ps-page { padding: 20px 12px 0; }
  .ps-card { padding: 22px 18px; border-radius: var(--ps-r-md); }
  .ps-card__title { font-size: 20px; }

  /* Una sola columna: dos selects lado a lado no entran en 375px */
  .ps-grid--2,
  .ps-grid--3 { grid-template-columns: 1fr; }

  .ps-steps { gap: 6px; }
  .ps-step__txt { font-size: 11px; }
  .ps-step__num { width: 16px; height: 16px; font-size: 10px; margin-right: 4px; }

  /* Acciones apiladas: el CTA principal arriba y a lo ancho */
  .ps-actions { flex-direction: column-reverse; align-items: stretch; }
  .ps-btn { width: 100%; }

  .ps-logo { max-width: 190px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}
