/* ── Alas Flight Form v2 — Estilos ── */

.aff-wrap {
  max-width: 1200px;
  margin: 0 auto;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: #1a1a2e;
}

/* ── Notices ── */
.aff-notice {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 16px 20px; border-radius: 12px; margin-bottom: 24px;
  font-size: 14px; line-height: 1.5;
}
.aff-notice svg { width: 22px; height: 22px; flex-shrink: 0; margin-top: 1px;
  fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.aff-notice strong { display: block; font-size: 15px; margin-bottom: 2px; }
.aff-success { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.aff-error   { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }

/* ── Section card ── */
.aff-section {
  background: #fff; border: 1px solid #e8eaf0; border-radius: 16px;
  padding: 28px 32px; margin-bottom: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.aff-section-title {
  display: flex; align-items: center; gap: 10px;
  font-size: 15px; font-weight: 600; color: #374151;
  margin: 0 0 22px; padding-bottom: 14px; border-bottom: 1px solid #f0f1f5;
}
.aff-section-title svg { width: 20px; height: 20px; fill: none; stroke: #004e9f;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }

/* ── Grid ── */
.aff-grid { display: grid; gap: 18px; }
.aff-grid-2 { grid-template-columns: 1fr 1fr; }

/* ── Fields ── */
.aff-field { display: flex; flex-direction: column; gap: 6px; position: relative; }
.aff-field label { font-size: 13px; font-weight: 500; color: #4b5563; }
.aff-required { color: #ef4444; }

.aff-field input[type="text"],
.aff-field input[type="email"],
.aff-field input[type="tel"],
.aff-field input[type="date"],
.aff-field input[type="number"],
.aff-field select {
  width: 100%; padding: 10px 14px;
  border: 1.5px solid #e0e2ea; border-radius: 10px;
  font-size: 14px; color: #1a1a2e; background: #fafbfc;
  transition: border-color .18s, box-shadow .18s, background .18s;
  outline: none; box-sizing: border-box; -webkit-appearance: none; appearance: none;
}
.aff-field input:focus,
.aff-field select:focus {
  border-color: #6366f1; background: #fff;
  box-shadow: 0 0 0 3px rgba(99,102,241,.12);
}
.aff-field select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236b7280' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; padding-right: 38px; cursor: pointer;
}

/* ── Airport autocomplete ── */
.aff-airport-wrap { position: relative; }
.aff-airport-icon {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  width: 16px; height: 16px; fill: none; stroke: #9ca3af;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; z-index: 1;
}
.aff-airport-input { padding-left: 36px !important; }
.aff-airport-input.aff-selected { border-color: #a5b4fc !important; background: #f5f3ff !important; font-weight: 500; }

/* ── Tooltip de error ── */
.aff-field-error {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 11px;
  background: #1e1e2e;
  color: #fca5a5;
  font-size: 12px;
  font-weight: 500;
  border-radius: 8px;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: 0 4px 14px rgba(0,0,0,.18);
  animation: aff-tooltip-in .15s ease;
}
.aff-field-error::before {
  content: '\26A0';
  font-size: 11px;
  flex-shrink: 0;
}
.aff-field-error::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 16px;
  border: 5px solid transparent;
  border-top-color: #1e1e2e;
}
@keyframes aff-tooltip-in {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.aff-autocomplete {
  display: none; position: absolute; top: calc(100% + 4px); left: 0; right: 0;
  background: #fff; border: 1.5px solid #e0e2ea; border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,.1); z-index: 9999; overflow: hidden;
  max-height: 260px; overflow-y: auto;
}
.aff-autocomplete.aff-open { display: block; }
.aff-autocomplete-item {
  padding: 10px 16px; font-size: 13.5px; cursor: pointer;
  transition: background .12s; border-bottom: 1px solid #f3f4f6; line-height: 1.4;
}
.aff-autocomplete-item:last-child { border-bottom: none; }
.aff-autocomplete-item:hover,
.aff-autocomplete-item.aff-active { background: #f0f1ff; color: #4338ca; }
.aff-autocomplete-empty,
.aff-autocomplete-loading { padding: 14px 16px; font-size: 13px; color: #9ca3af; text-align: center; }

/* ── Date ── */
.aff-date-wrap { position: relative; }
.aff-date-wrap svg {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  width: 16px; height: 16px; fill: none; stroke: #9ca3af;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; pointer-events: none;
}
.aff-date-wrap input[type="date"] { padding-left: 36px !important; cursor: pointer; }

/* ── Passengers ── */
.aff-passengers-wrap {
  display: flex; align-items: center;
  border: 1.5px solid #e0e2ea; border-radius: 10px; overflow: hidden; background: #fafbfc;
}
.aff-pax-btn {
  width: 40px; min-width: 40px; height: 40px; border: none; background: none;
  font-size: 20px; color: #6366f1; cursor: pointer; transition: background .15s;
  display: flex; align-items: center; justify-content: center;
}
.aff-pax-btn:hover { background: #ede9fe; }
.aff-passengers-wrap input[type="number"] {
  flex: 1; text-align: center; border: none !important; box-shadow: none !important;
  border-radius: 0 !important; background: transparent !important;
  font-weight: 600; font-size: 15px; padding: 0 !important; -moz-appearance: textfield;
}
.aff-passengers-wrap input[type="number"]::-webkit-inner-spin-button,
.aff-passengers-wrap input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; }

/* ── Submit ── */
.aff-submit-wrap { display: flex; justify-content: flex-end; margin-top: 4px; }
.aff-submit {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 13px 32px; background: linear-gradient(135deg, #f96501 0%, #f96501 100%);
  color: #fff; border: none; border-radius: 12px; font-size: 15px; font-weight: 600;
  cursor: pointer; transition: transform .15s, box-shadow .15s;
  box-shadow: 0 4px 14px rgba(99,102,241,.35); letter-spacing: .02em;
}
.aff-submit svg { width: 18px; height: 18px; fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.aff-submit:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(99,102,241,.45); }

/* ═══════════════════════════════════════
   VARIANTE B — Buscador horizontal
═══════════════════════════════════════ */
.aff-hidden { display: none !important; }

/* Searchbar pill */
.aff-searchbar {
  display: flex; align-items: flex-end; gap: 0;
  background: #fff; border: 1.5px solid #e0e2ea; border-radius: 20px;
  padding: 16px 20px; box-shadow: 0 4px 20px rgba(0,0,0,.08);
  flex-wrap: wrap; gap: 12px;
}

.aff-sb-field { display: flex; flex-direction: column; gap: 4px; position: relative; }
.aff-sb-field label { font-size: 11px; font-weight: 700; color: #004e9f; text-transform: uppercase; letter-spacing: .06em; padding-left: 2px; }

.aff-sb-airport { flex: 2 1 180px; min-width: 160px; }
.aff-sb-date    { flex: 1 1 130px; min-width: 120px; }
.aff-sb-pax     { flex: 0 1 120px; min-width: 110px; }
.aff-sb-cabin   { flex: 0 1 130px; min-width: 120px; }

/* Fields inside searchbar — override to match pill style */
.aff-searchbar .aff-field input,
.aff-searchbar .aff-field select,
.aff-sb-field input,
.aff-sb-field select,
.aff-sb-date input,
.aff-sb-cabin select {
  border: 1.5px solid #e0e2ea !important; border-radius: 10px !important;
  padding: 9px 12px !important; font-size: 14px !important; background: #fafbfc !important;
  width: 100% !important; box-sizing: border-box !important;
}
.aff-sb-date .aff-date-wrap input { padding-left: 34px !important; }
.aff-sb-field .aff-passengers-wrap { border: 1.5px solid #e0e2ea; border-radius: 10px; }
.aff-sb-field .aff-passengers-wrap input { height: 38px; }
.aff-sb-field .aff-pax-btn { height: 38px; }

/* Fix: icono aeropuerto dentro del searchbar no debe solaparse con el texto */
.aff-searchbar .aff-airport-wrap .aff-airport-input {
  padding-left: 38px !important;
}

/* El ícono dentro del searchbar debe alinearse con el input más compacto */
.aff-searchbar .aff-airport-wrap .aff-airport-icon {
  left: 10px;
  width: 15px;
  height: 15px;
}

/* Arrow separator */
.aff-sb-arrow {
  display: flex; align-items: flex-end; padding-bottom: 9px; flex-shrink: 0; color: #d1d5db;
}
.aff-sb-arrow svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Search button */
.aff-sb-search-btn {
  display: flex; align-items: center; gap: 7px; flex-shrink: 0; align-self: flex-end;
  padding: 10px 22px; background: linear-gradient(135deg, #f96501, #f96501);
  color: #fff; border: none; border-radius: 12px; font-size: 14px; font-weight: 600;
  cursor: pointer; transition: transform .15s, box-shadow .15s;
  box-shadow: 0 3px 10px rgba(99,102,241,.35); white-space: nowrap;
}
.aff-sb-search-btn svg { width: 16px; height: 16px; fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.aff-sb-search-btn:hover { transform: translateY(-1px); box-shadow: 0 5px 16px rgba(99,102,241,.45); }

/* ── Paso 2: resumen ── */
.aff-summary {
  display: flex; align-items: center; gap: 16px;
  background: #f5f3ff; border: 1.5px solid #c7d2fe; border-radius: 14px;
  padding: 14px 20px; margin-bottom: 20px;
}
.aff-back-btn {
  display: flex; align-items: center; gap: 6px; flex-shrink: 0;
  background: none; border: 1.5px solid #c7d2fe; border-radius: 8px;
  padding: 7px 12px; font-size: 13px; font-weight: 500; color: #4338ca;
  cursor: pointer; transition: background .15s; white-space: nowrap;
}
.aff-back-btn:hover { background: #ede9fe; }
.aff-back-btn svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.aff-summary-content { flex: 1; }
.aff-summary-route {
  display: flex; align-items: center; gap: 10px; margin-bottom: 4px;
}
.aff-summary-iata { font-size: 22px; font-weight: 800; color: #4338ca; letter-spacing: -.5px; }
.aff-summary-route svg { width: 18px; height: 18px; fill: none; stroke: #818cf8; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.aff-summary-details { font-size: 13px; color: #6b7280; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.aff-summary-dot { color: #d1d5db; }

/* ── Responsive ── */
@media (max-width: 700px) {
  .aff-section { padding: 18px 16px; }
  .aff-grid-2  { grid-template-columns: 1fr; }
  .aff-submit  { width: 100%; justify-content: center; }
  .aff-submit-wrap { justify-content: stretch; }
  .aff-searchbar { flex-direction: column; border-radius: 16px; }
  .aff-sb-airport,
  .aff-sb-date,
  .aff-sb-pax,
  .aff-sb-cabin { flex: 1 1 100%; min-width: 0; width: 100%; }
  .aff-sb-arrow { display: none; }
  .aff-sb-search-btn { width: 100%; justify-content: center; }
  .aff-summary { flex-direction: column; align-items: flex-start; }
}
