/* ═══════════════════════════════════════════════════════════════
   SOLICITUD DE VIAJE DE SERVICIO
   Consejería de Educación en Alemania
   Estilos principales — Mobile-first
═══════════════════════════════════════════════════════════════ */

/* ── Variables ── */
:root {
  --blue-deep:    #0a2744;
  --blue-mid:     #0d3561;
  --blue-light:   #1a5296;
  --blue-pale:    #e8f0fb;
  --gold:         #c8a84e;
  --gold-light:   #f0e4b8;
  --text-dark:    #1a1f2e;
  --text-mid:     #4a5568;
  --text-light:   #718096;
  --border:       #d1d9e6;
  --border-focus: #1a5296;
  --bg:           #f5f7fb;
  --white:        #ffffff;
  --red:          #c53030;
  --green:        #276749;
  --green-bg:     #f0fff4;
  --red-bg:       #fff5f5;
  --shadow-sm:    0 1px 3px rgba(10,39,68,0.08), 0 1px 2px rgba(10,39,68,0.04);
  --shadow-md:    0 4px 16px rgba(10,39,68,0.10), 0 2px 6px rgba(10,39,68,0.06);
  --shadow-lg:    0 10px 40px rgba(10,39,68,0.14), 0 4px 12px rgba(10,39,68,0.08);
  --radius:       12px;
  --radius-sm:    8px;
  --radius-lg:    16px;
  --transition:   all 0.22s cubic-bezier(0.4,0,0.2,1);
}

/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  font-family: 'Source Sans 3', 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text-dark);
  line-height: 1.6;
  min-height: 100vh;
  /* Subtle geometric background */
  background-image:
    radial-gradient(circle at 20% 80%, rgba(26,82,150,0.04) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(200,168,78,0.04) 0%, transparent 50%);
}

/* ── Header ── */
.site-header {
  background: var(--blue-deep);
  padding: 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(0,0,0,0.25);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px;
  max-width: 860px;
  margin: 0 auto;
}

.header-logo {
  height: 56px;
  width: auto;
  display: block;
  object-fit: contain;
}

/* ── API Status ── */
.api-status {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 20px;
  padding: 6px 12px;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
}
.api-status:hover {
  background: rgba(255,255,255,0.16);
  border-color: rgba(255,255,255,0.30);
}
.api-status:active { transform: scale(0.97); }

.api-retry-icon {
  font-size: 1rem;
  color: rgba(255,255,255,0.7);
  line-height: 1;
  margin-left: 2px;
  transition: var(--transition);
}
.api-status.checking .api-retry-icon {
  display: inline !important;
  animation: spin 0.8s linear infinite;
}

.api-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #a0aec0;
  flex-shrink: 0;
  transition: var(--transition);
}
.api-dot.online  { background: #68d391; box-shadow: 0 0 6px rgba(104,211,145,0.7); animation: pulse-green 2s infinite; }
.api-dot.offline { background: #fc8181; box-shadow: 0 0 6px rgba(252,129,129,0.7); }

@keyframes pulse-green {
  0%, 100% { box-shadow: 0 0 4px rgba(104,211,145,0.5); }
  50%       { box-shadow: 0 0 10px rgba(104,211,145,0.9); }
}

.api-label {
  font-family: 'Source Sans 3', sans-serif;
  font-size: 0.75rem;
  font-weight: 500;
  color: rgba(255,255,255,0.85);
  white-space: nowrap;
}

/* ── Main / Wizard ── */
.wizard-main {
  max-width: 860px;
  margin: 0 auto;
  padding: 28px 16px 60px;
}

.wizard-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  position: relative;
}

.wizard-title-bar {
  background: linear-gradient(135deg, var(--blue-deep) 0%, var(--blue-mid) 100%);
  padding: 28px 32px 24px;
  position: relative;
  overflow: hidden;
}

.wizard-title-bar::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--gold) 0%, transparent 70%);
}

.wizard-title {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: clamp(1.3rem, 4vw, 1.8rem);
  font-weight: 400;
  color: var(--white);
  letter-spacing: 0.01em;
  line-height: 1.2;
}

.wizard-subtitle {
  font-size: 0.82rem;
  color: rgba(255,255,255,0.62);
  margin-top: 4px;
  font-weight: 300;
  letter-spacing: 0.03em;
}

/* ── Step Progress ── */
.step-progress {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 20px 28px 16px;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  position: relative;
  gap: 4px;
}

.step-track {
  position: absolute;
  top: 36px;
  left: calc(28px + 18px);
  right: calc(28px + 18px);
  height: 2px;
  background: var(--border);
  z-index: 0;
}

.step-fill {
  height: 100%;
  background: var(--blue-light);
  transition: width 0.4s cubic-bezier(0.4,0,0.2,1);
  width: 0%;
}

.step-dot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 1;
  flex: 1;
  min-width: 0;
  transition: var(--transition);
}

.step-num {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-light);
  transition: var(--transition);
  flex-shrink: 0;
}

.step-name {
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--text-light);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 70px;
  transition: var(--transition);
}

.step-dot.active .step-num {
  background: var(--blue-light);
  border-color: var(--blue-light);
  color: white;
  box-shadow: 0 0 0 4px rgba(26,82,150,0.15);
}
.step-dot.active .step-name { color: var(--blue-light); font-weight: 600; }

.step-dot.completed .step-num {
  background: var(--blue-deep);
  border-color: var(--blue-deep);
  color: white;
}
.step-dot.completed .step-num::after {
  content: '✓';
  font-size: 0.8rem;
}
.step-dot.completed .step-num { font-size: 0; }
.step-dot.completed .step-name { color: var(--blue-deep); }

.step-dot:disabled { cursor: default; }

/* ── Step Panels ── */
.step-panel {
  display: none;
  padding: 28px 28px 24px;
  animation: fadeIn 0.3s ease;
}
.step-panel.active { display: block; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateX(16px); }
  to   { opacity: 1; transform: translateX(0); }
}

.step-panel.going-back {
  animation: fadeInBack 0.3s ease;
}
@keyframes fadeInBack {
  from { opacity: 0; transform: translateX(-16px); }
  to   { opacity: 1; transform: translateX(0); }
}

.step-header { margin-bottom: 24px; }

.step-heading {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 1.35rem;
  font-weight: 400;
  color: var(--blue-deep);
  margin-bottom: 6px;
}

.step-desc {
  font-size: 0.88rem;
  color: var(--text-mid);
  line-height: 1.5;
}

/* ── Field Groups ── */
.field-group {
  margin-bottom: 20px;
}

.field-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-mid);
  margin-bottom: 6px;
  letter-spacing: 0.02em;
}

.required { color: var(--red); margin-left: 2px; }

.field-input,
.field-select,
.field-textarea {
  width: 100%;
  padding: 11px 14px;
  font-size: 0.95rem;
  font-family: 'Source Sans 3', sans-serif;
  color: var(--text-dark);
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  outline: none;
  transition: var(--transition);
  -webkit-appearance: none;
  appearance: none;
}

.field-input:focus,
.field-select:focus,
.field-textarea:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(26,82,150,0.12);
}

.field-input.error,
.field-select.error,
.field-textarea.error {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(197,48,48,0.1);
}

.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='%234a5568' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 12px;
  padding-right: 36px;
  cursor: pointer;
}

.field-textarea { resize: vertical; min-height: 80px; }

.field-hint {
  font-size: 0.78rem;
  color: var(--text-light);
  margin-top: 4px;
}

.field-error {
  font-size: 0.78rem;
  color: var(--red);
  margin-top: 4px;
  display: none;
}
.field-error.visible { display: block; }

/* ── Field Rows ── */
.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.field-row-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
}

@media (max-width: 580px) {
  .field-row, .field-row-3 { grid-template-columns: 1fr; gap: 0; }
}

/* ── Traveler Card ── */
.traveler-card {
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
  position: relative;
  transition: var(--transition);
}

.traveler-card:focus-within {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(26,82,150,0.08);
}

.traveler-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.traveler-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--blue-deep);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.btn-remove {
  background: none;
  border: none;
  color: var(--text-light);
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  transition: var(--transition);
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  gap: 4px;
}
.btn-remove:hover { color: var(--red); background: var(--red-bg); }

/* ── Add buttons ── */
.btn-add-traveler,
.btn-add-tramo,
.btn-add-hotel {
  display: flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: 1.5px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 11px 18px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--blue-light);
  cursor: pointer;
  width: 100%;
  justify-content: center;
  margin-top: 4px;
  margin-bottom: 20px;
  transition: var(--transition);
  font-family: 'Source Sans 3', sans-serif;
}
.btn-add-traveler:hover,
.btn-add-tramo:hover,
.btn-add-hotel:hover {
  background: var(--blue-pale);
  border-color: var(--blue-light);
  border-style: solid;
}

/* ── Type Picker (Tren/Avion selector) ── */
.type-picker {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 16px;
  margin: 8px 0 16px;
  background: var(--blue-pale);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  animation: fadeIn 0.2s ease;
}

.type-picker-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-mid);
}

.type-picker-buttons {
  display: flex;
  gap: 12px;
}

.type-picker-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 24px;
  background: var(--white);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-dark);
  transition: var(--transition);
  font-family: 'Source Sans 3', sans-serif;
}

.type-picker-btn:hover {
  border-color: var(--blue-light);
  background: var(--blue-pale);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

/* ── Vuelta button accent ── */
.btn-add-vuelta {
  border-color: var(--gold-light);
  color: var(--blue-deep);
}
.btn-add-vuelta:hover {
  background: var(--gold-light);
  border-color: var(--gold);
  border-style: solid;
}

/* ── Save Data Row ── */
.save-data-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 24px;
  padding: 12px 16px;
  background: var(--blue-pale);
  border-radius: var(--radius-sm);
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 0.875rem;
  color: var(--text-mid);
  user-select: none;
}

.checkbox-label input[type="checkbox"] { display: none; }

.checkbox-custom {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-radius: 4px;
  background: var(--white);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.checkbox-label input:checked + .checkbox-custom {
  background: var(--blue-light);
  border-color: var(--blue-light);
}
.checkbox-label input:checked + .checkbox-custom::after {
  content: '✓';
  color: white;
  font-size: 12px;
  font-weight: 700;
}

.btn-clear-storage {
  background: none;
  border: none;
  font-size: 0.78rem;
  color: var(--text-light);
  cursor: pointer;
  text-decoration: underline;
  padding: 4px;
  font-family: 'Source Sans 3', sans-serif;
}
.btn-clear-storage:hover { color: var(--red); }

/* ── Transport Cards ── */
.transport-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

@media (max-width: 480px) {
  .transport-cards { grid-template-columns: 1fr; }
}

.transport-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 18px 12px;
  background: var(--white);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
  font-family: 'Source Sans 3', sans-serif;
}

.transport-card:hover {
  border-color: var(--blue-light);
  background: var(--blue-pale);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.transport-card.selected {
  border-color: var(--blue-light);
  background: var(--blue-pale);
  box-shadow: 0 0 0 3px rgba(26,82,150,0.15);
}

.transport-icon { font-size: 1.8rem; line-height: 1; }
.transport-name { font-size: 0.9rem; font-weight: 600; color: var(--text-dark); }
.transport-desc { font-size: 0.72rem; color: var(--text-light); }

/* ── API Banner ── */
.api-banner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
  font-size: 0.875rem;
}

.api-banner.online  { background: var(--green-bg); border: 1px solid #c6f6d5; }
.api-banner.offline { background: var(--red-bg);   border: 1px solid #fed7d7; }

.api-banner-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-top: 4px;
  flex-shrink: 0;
}
.api-banner.online  .api-banner-dot { background: var(--green); }
.api-banner.offline .api-banner-dot { background: var(--red); }

.api-banner-text strong {
  display: block;
  margin-bottom: 2px;
  color: var(--text-dark);
}
.api-banner-text span { color: var(--text-mid); line-height: 1.4; }
.api-banner.online  .api-banner-text strong { color: var(--green); }
.api-banner.offline .api-banner-text strong { color: var(--red); }

/* ── Tramo Card ── */
.tramo-card {
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 20px;
  overflow: hidden;
}

.tramo-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  background: var(--blue-deep);
  color: white;
}

.tramo-title {
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.tramo-body { padding: 20px; }

/* ── Train search ── */
.train-search-row {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  flex-wrap: wrap;
}

.train-search-row .field-group { flex: 1; min-width: 140px; margin-bottom: 0; }

.btn-search-train {
  background: var(--blue-light);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  padding: 11px 18px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition);
  font-family: 'Source Sans 3', sans-serif;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.btn-search-train:hover { background: var(--blue-deep); }
.btn-search-train:disabled { background: #a0aec0; cursor: not-allowed; }

/* Train result selected: tarjeta de conexión elegida */
.train-result-selected {
  background: #fff;
  border: 1.5px solid #c6f6d5;
  border-radius: var(--radius-sm);
  margin-top: 12px;
  overflow: hidden;
}

.train-summary-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--green-bg);
  border-bottom: 1px solid #c6f6d5;
  padding: 7px 14px;
}

.train-summary-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--green);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.train-summary-body {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 14px;
  font-size: 0.875rem;
}

.train-summary-extra {
  padding: 5px 14px 9px;
  font-size: 0.72rem;
  color: var(--gold);
  font-style: italic;
}

.btn-change-train {
  background: none;
  border: none;
  font-size: 0.78rem;
  color: var(--blue-light);
  cursor: pointer;
  text-decoration: underline;
  font-family: 'Source Sans 3', sans-serif;
}

/* Manual entry ── */
.manual-fields { margin-top: 16px; }

/* Image dropzone ── */
.image-dropzone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 20px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  background: var(--bg);
  margin-top: 16px;
}
.image-dropzone:hover,
.image-dropzone.drag-over {
  border-color: var(--blue-light);
  background: var(--blue-pale);
}

.dropzone-icon { font-size: 2rem; margin-bottom: 8px; opacity: 0.6; }
.dropzone-text { font-size: 0.82rem; color: var(--text-mid); }
.dropzone-hint { font-size: 0.75rem; color: var(--text-light); margin-top: 4px; }

.image-previews {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.image-preview-item {
  position: relative;
  width: 72px;
  height: 72px;
}
.image-preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--border);
}
.image-preview-remove {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 20px;
  height: 20px;
  background: var(--red);
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* ── Toggle Switch ── */
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.toggle-label {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-dark);
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 28px;
  flex-shrink: 0;
}

.toggle-switch input { display: none; }

.toggle-slider {
  position: absolute;
  inset: 0;
  background: #cbd5e0;
  border-radius: 28px;
  transition: var(--transition);
  cursor: pointer;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  left: 3px;
  top: 3px;
  width: 22px;
  height: 22px;
  background: white;
  border-radius: 50%;
  transition: var(--transition);
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

.toggle-switch input:checked + .toggle-slider { background: var(--blue-light); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(22px); }

/* ── Hotel Card ── */
.hotel-card {
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 16px;
}
.hotel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.hotel-title { font-size: 0.8rem; font-weight: 700; color: var(--blue-deep); text-transform: uppercase; letter-spacing: 0.06em; }
.hotel-body { padding: 20px; }
.nights-badge {
  display: inline-block;
  background: var(--blue-pale);
  color: var(--blue-light);
  font-weight: 700;
  font-size: 0.82rem;
  padding: 3px 10px;
  border-radius: 20px;
  margin-top: 8px;
}

/* ── Review Panel ── */
.review-section {
  margin-bottom: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.review-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.review-section-title {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--blue-deep);
}

.btn-edit-section {
  background: none;
  border: none;
  font-size: 0.78rem;
  color: var(--blue-light);
  cursor: pointer;
  text-decoration: underline;
  padding: 2px 6px;
  font-family: 'Source Sans 3', sans-serif;
  transition: var(--transition);
}
.btn-edit-section:hover { color: var(--blue-deep); }

.review-fields { padding: 12px 16px; }

.review-field {
  display: flex;
  gap: 12px;
  padding: 6px 0;
  border-bottom: 1px solid #f0f4f8;
  font-size: 0.875rem;
}
.review-field:last-child { border-bottom: none; }

.review-field-label {
  color: var(--text-light);
  min-width: 160px;
  flex-shrink: 0;
  font-size: 0.82rem;
}
.review-field-value { color: var(--text-dark); font-weight: 500; }

/* ── Step Nav ── */
.step-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  gap: 12px;
}

.step-nav--final { justify-content: space-between; }

.btn-prev {
  display: flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 18px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-mid);
  cursor: pointer;
  transition: var(--transition);
  font-family: 'Source Sans 3', sans-serif;
}
.btn-prev:hover { border-color: var(--blue-light); color: var(--blue-light); }

.btn-next {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--blue-deep);
  border: none;
  border-radius: var(--radius-sm);
  padding: 11px 24px;
  font-size: 0.9rem;
  font-weight: 600;
  color: white;
  cursor: pointer;
  transition: var(--transition);
  font-family: 'Source Sans 3', sans-serif;
  margin-left: auto;
}
.btn-next:hover { background: var(--blue-light); transform: translateX(2px); }

.btn-generate {
  display: flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, var(--blue-deep) 0%, var(--blue-light) 100%);
  border: none;
  border-radius: var(--radius-sm);
  padding: 14px 32px;
  font-size: 1rem;
  font-weight: 700;
  color: white;
  cursor: pointer;
  transition: var(--transition);
  font-family: 'Source Sans 3', sans-serif;
  letter-spacing: 0.02em;
  box-shadow: 0 4px 15px rgba(10,39,68,0.35);
  position: relative;
  overflow: hidden;
}
.btn-generate::before {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 3px;
  background: var(--gold);
}
.btn-generate:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(10,39,68,0.45);
}

/* ── Modal ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10,39,68,0.55);
  backdrop-filter: blur(3px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: fadeOverlay 0.2s ease;
}
@keyframes fadeOverlay { from { opacity: 0; } to { opacity: 1; } }

.modal-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 560px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 60px rgba(0,0,0,0.3);
  animation: slideUp 0.25s cubic-bezier(0.4,0,0.2,1);
}
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px 14px;
  border-bottom: 1px solid var(--border);
}

.modal-title {
  font-family: 'DM Serif Display', serif;
  font-size: 1.1rem;
  font-weight: 400;
  color: var(--blue-deep);
}

.modal-close {
  background: none;
  border: none;
  font-size: 1rem;
  color: var(--text-light);
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}
.modal-close:hover { background: var(--bg); color: var(--text-dark); }

.modal-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 22px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.modal-toolbar-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-mid);
}

.transfer-select {
  width: auto;
  min-width: 200px;
  padding: 7px 10px;
  font-size: 0.82rem;
}

.modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 22px;
}

.modal-footer {
  padding: 14px 22px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
}

.btn-manual-entry {
  background: none;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 16px;
  font-size: 0.82rem;
  color: var(--text-mid);
  cursor: pointer;
  transition: var(--transition);
  font-family: 'Source Sans 3', sans-serif;
}
.btn-manual-entry:hover { border-color: var(--blue-light); color: var(--blue-light); }

/* ── Train Results ── */
.train-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 32px;
  color: var(--text-mid);
  gap: 14px;
  font-size: 0.875rem;
}

.train-result-card {
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.train-result-card:hover {
  border-color: var(--blue-light);
  background: var(--blue-pale);
}

.train-times {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1rem;
  font-weight: 700;
  color: var(--blue-deep);
}
.train-arrow { color: var(--text-light); font-size: 0.9rem; }
.train-duration { font-size: 0.78rem; color: var(--text-light); font-weight: 400; }
.train-info {
  font-size: 0.78rem;
  color: var(--text-mid);
  text-align: right;
  flex-shrink: 0;
}
.train-number { font-weight: 600; color: var(--text-dark); }
.train-transfers { color: var(--text-light); }
.no-results { text-align: center; padding: 24px; color: var(--text-mid); font-size: 0.875rem; }

/* Desglose de trasbordos en tarjeta del modal */
.train-legs {
  flex-basis: 100%;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.train-leg {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  color: var(--text-mid);
}
.train-leg-nr { font-weight: 700; color: var(--text-dark); min-width: 52px; }
.train-leg-times { color: var(--blue-deep); font-weight: 500; white-space: nowrap; }
.train-leg-route { color: var(--text-light); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.train-transfer-wait {
  font-size: 0.72rem;
  color: var(--gold);
  padding-left: 60px;
  font-style: italic;
}

/* Desglose en pill de resultado seleccionado */
.train-selected-legs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  margin-top: 4px;
  font-size: 0.72rem;
}
.sel-leg { color: var(--text-dark); font-weight: 500; }
.sel-wait { color: var(--gold); font-style: italic; }

/* Tarjeta de conexión en el paso de revisión */
.review-train-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin: 10px 0 2px;
  padding: 12px 14px;
  background: #fff;
  border: 1.5px solid var(--border);
  border-left: 3px solid var(--gold);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
}

/* ── PDF Loading ── */
.pdf-loading {
  position: fixed;
  inset: 0;
  background: rgba(10,39,68,0.65);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pdf-loading-inner {
  background: white;
  border-radius: var(--radius);
  padding: 36px 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow-lg);
  font-size: 0.9rem;
  color: var(--text-mid);
}

.pdf-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--blue-light);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Train Options Section ── */
.train-options {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-top: 16px;
}
.train-options-title {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-mid);
  margin-bottom: 14px;
}

/* ── Segment separator ── */
.segment-separator {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 8px 0 20px;
  color: var(--text-light);
  font-size: 0.8rem;
}
.segment-separator::before,
.segment-separator::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ── Toasts / Alerts ── */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--text-dark);
  color: white;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  box-shadow: var(--shadow-lg);
  z-index: 400;
  animation: toastIn 0.3s ease;
  max-width: 320px;
}
.toast.error { background: var(--red); }
.toast.success { background: var(--green); }
@keyframes toastIn { from { transform: translateY(16px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* ── Responsive ── */
@media (max-width: 640px) {
  .wizard-main { padding: 12px 8px 48px; }
  .wizard-title-bar { padding: 20px 20px 18px; }
  .step-progress { padding: 16px 16px 12px; }
  .step-track { left: calc(16px + 18px); right: calc(16px + 18px); }
  .step-panel { padding: 20px 16px 18px; }
  .step-name { display: none; }
  .header-logo { height: 44px; }
  .btn-generate { padding: 12px 20px; font-size: 0.9rem; }
  .train-result-card { flex-direction: column; align-items: flex-start; }
  .train-info { text-align: left; }
  .modal-card { max-height: 90vh; }
}

@media (max-width: 380px) {
  .step-num { width: 30px; height: 30px; font-size: 0.78rem; }
  .save-data-row { flex-direction: column; align-items: flex-start; }
}

/* ── Dropzone split ── */
.dropzone-split {
  display: flex;
  gap: 10px;
  align-items: stretch;
}

.dropzone-split .image-dropzone {
  flex: 1;
  margin-top: 0;
}

.btn-paste-clipboard {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 16px;
  background: var(--white);
  border: 1.5px dashed var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-mid);
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 500;
  font-family: 'Source Sans 3', sans-serif;
  text-align: center;
  transition: var(--transition);
  flex-shrink: 0;
  width: 90px;
  line-height: 1.4;
}
.btn-paste-clipboard svg { color: var(--blue-light); flex-shrink: 0; }
.btn-paste-clipboard:hover {
  background: var(--blue-pale);
  border-color: var(--blue-light);
  border-style: solid;
  color: var(--blue-light);
}
.btn-paste-clipboard:active { transform: scale(0.97); }
.btn-paste-clipboard.success {
  background: var(--green-bg);
  border-color: var(--green);
  border-style: solid;
  color: var(--green);
}

@media (max-width: 480px) {
  .dropzone-split { flex-direction: column; }
  .btn-paste-clipboard { width: 100%; flex-direction: row; height: auto; padding: 10px 14px; }
}

/* ── Station Autocomplete ── */
.station-autocomplete-wrap { position: relative; }

.station-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 50;
  background: var(--white);
  border: 1.5px solid var(--border-focus);
  border-top: none;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  box-shadow: var(--shadow-md);
  max-height: 220px;
  overflow-y: auto;
}

.station-dropdown-item {
  padding: 10px 14px;
  cursor: pointer;
  font-size: 0.875rem;
  color: var(--text-dark);
  border-bottom: 1px solid #f0f4f8;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background 0.12s;
}
.station-dropdown-item:last-child { border-bottom: none; }
.station-dropdown-item:hover,
.station-dropdown-item.focused { background: var(--blue-pale); }
.station-dropdown-item::before {
  content: '🚉';
  font-size: 0.85rem;
  flex-shrink: 0;
}
.station-dropdown-item.loading::before { content: '⟳'; }
.station-dropdown-empty {
  padding: 12px 14px;
  font-size: 0.82rem;
  color: var(--text-light);
  font-style: italic;
}

/* ── Utility ── */
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
