/* ══════════════════════════════════════════════════
   PASeABORDO — Passenger Form
   Paleta:
     Fondo principal  : #F4F6F8  (blanco frío)
     Texto / Cabeceras: #07366B  (azul marino oscuro)
     Botón principal  : #087DC1  (azul intenso)
     Acento           : #C2185B  (fucsia / magenta)
   Tipografía: Google Sans (fallback: Nunito, sans-serif)
══════════════════════════════════════════════════ */

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

:root {
  --color-bg:        #F4F6F8;
  --color-navy:      #07366B;
  --color-blue:      #087DC1;
  --color-blue-dark: #065fa0;
  --color-blue-lt:   #e8f4fc;
  --color-accent:    #C2185B;
  --color-accent-lt: #fce4ec;
  --color-white:     #ffffff;
  --color-border:    #cdd6e0;
  --color-muted:     #637080;
  --color-success:   #1a7f5a;
  --color-error:     #c0392b;

  --font-base: 'Google Sans', 'Nunito', 'Segoe UI', Arial, sans-serif;

  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;

  --shadow-card: 0 8px 32px rgba(7, 54, 107, 0.10), 0 2px 8px rgba(7, 54, 107, 0.06);
  --shadow-btn:  0 4px 16px rgba(8, 125, 193, 0.35);
  --shadow-focus:0 0 0 3px rgba(8, 125, 193, 0.22);

  --transition: 0.22s ease;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-base);
  background-color: var(--color-bg);
  color: var(--color-navy);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

/* ─── UTILITY ─── */
.hidden-field {
  display: none;
}

.required-star {
  color: var(--color-accent);
  font-weight: 700;
  margin-left: 2px;
}

/* ─── SITE HEADER ─── */
.site-header {
  background: linear-gradient(135deg, var(--color-navy) 0%, #0b4d97 60%, #087DC1 100%);
  color: var(--color-white);
  padding: 0;
  position: relative;
  overflow: hidden;
}

.site-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='60'%3E%3Ccircle cx='30' cy='30' r='28' fill='none' stroke='rgba(255,255,255,0.04)' stroke-width='2'/%3E%3C/svg%3E") center/60px;
  pointer-events: none;
}

/* Magenta accent stripe at top */
.site-header::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--color-accent), #e91e8c, var(--color-accent));
}

.header-inner {
  max-width: 720px;
  margin: 0 auto;
  padding: 32px 24px 28px;
  position: relative;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.brand-icon {
  font-size: 1.6rem;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
  display: inline-block;
  animation: fly 3s ease-in-out infinite alternate;
}

@keyframes fly {
  from { transform: translateX(-4px) rotate(-5deg); }
  to   { transform: translateX(4px)  rotate(5deg);  }
}

.brand-name {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.header-tagline {
  font-size: 0.875rem;
  opacity: 0.78;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 500;
}

/* ─── MAIN WRAPPER ─── */
.main-wrapper {
  flex: 1;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 16px 56px;
}

/* ─── CARD ─── */
.card {
  background: var(--color-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  width: 100%;
  max-width: 680px;
  overflow: hidden;
  border: 1px solid rgba(7, 54, 107, 0.07);
}

.card-header {
  padding: 32px 36px 24px;
  border-bottom: 2px solid var(--color-bg);
  position: relative;
}

.card-header::after {
  content: '';
  position: absolute;
  bottom: -2px; left: 36px;
  width: 56px; height: 2px;
  background: var(--color-accent);
  border-radius: 2px;
}

.card-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-navy);
  margin-bottom: 8px;
}

.card-subtitle {
  font-size: 0.875rem;
  color: var(--color-muted);
  line-height: 1.55;
}

/* ─── FORM ─── */
.passenger-form {
  padding: 32px 36px 36px;
}

/* ─── FIELDSET / SECTION ─── */
.form-section {
  border: none;
  padding: 0;
  margin-bottom: 32px;
}

.form-section:last-of-type {
  margin-bottom: 24px;
}

.section-legend {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--color-muted);
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--color-border);
  width: 100%;
}

.legend-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--color-navy);
  color: var(--color-white);
  font-size: 0.7rem;
  font-weight: 700;
  flex-shrink: 0;
}

/* ─── FORM GROUP ─── */
.form-group {
  margin-bottom: 20px;
  position: relative;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* ─── LABELS ─── */
.form-label {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-navy);
  margin-bottom: 7px;
  cursor: pointer;
}

/* ─── INPUT WRAPPER ─── */
.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 14px;
  color: var(--color-blue);
  display: flex;
  align-items: center;
  pointer-events: none;
  transition: color var(--transition);
}

/* ─── FORM CONTROLS ─── */
.form-control {
  width: 100%;
  padding: 13px 16px 13px 44px;
  font-family: var(--font-base);
  font-size: 0.9375rem;
  color: var(--color-navy);
  background: var(--color-bg);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
  -webkit-appearance: none;
}

.form-control::placeholder {
  color: #a0adb8;
  font-weight: 400;
}

.form-control:hover {
  border-color: #9ab3cb;
  background: #f9fbfd;
}

.form-control:focus {
  border-color: var(--color-blue);
  background: var(--color-white);
  box-shadow: var(--shadow-focus);
}

.form-control:focus + .input-icon,
.input-wrapper:focus-within .input-icon {
  color: var(--color-blue);
}

/* Valid state */
.form-control:not(:placeholder-shown):valid {
  border-color: var(--color-success);
}

/* Invalid state (only after interaction) */
.form-control:not(:placeholder-shown):invalid {
  border-color: var(--color-error);
  background: #fff8f8;
}

/* Card number — special */
.card-input-wrapper .form-control {
  letter-spacing: 0.15em;
  padding-right: 120px; /* room for brand logos */
}

/* Card brands */
.card-brands {
  position: absolute;
  right: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
  pointer-events: none;
}

.brand-logo {
  height: 20px;
  width: auto;
  object-fit: contain;
  opacity: 0.75;
  transition: opacity var(--transition);
}

/* CVV */
.cvv-input {
  letter-spacing: 0.25em;
  font-size: 1.1rem;
}

/* ─── FIELD HINT ─── */
.field-hint {
  display: block;
  font-size: 0.75rem;
  color: var(--color-muted);
  margin-top: 5px;
  padding-left: 2px;
}

/* ─── CVV TOOLTIP ─── */
.cvv-tooltip-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-muted);
  display: inline-flex;
  align-items: center;
  padding: 2px;
  border-radius: 50%;
  transition: color var(--transition);
}

.cvv-tooltip-btn:hover,
.cvv-tooltip-btn:focus {
  color: var(--color-blue);
  outline: none;
}

.cvv-tooltip {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: var(--color-navy);
  color: var(--color-white);
  font-size: 0.78rem;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  width: max-content;
  max-width: 240px;
  z-index: 10;
  pointer-events: none;
  box-shadow: 0 4px 16px rgba(0,0,0,0.18);
  line-height: 1.45;
}

.cvv-tooltip::before {
  content: '';
  position: absolute;
  bottom: 100%; right: 16px;
  border: 6px solid transparent;
  border-bottom-color: var(--color-navy);
}

.cvv-tooltip.visible {
  display: block;
  animation: fadeIn 0.18s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0);    }
}

/* ─── SECURITY BADGE ─── */
.security-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: #eaf7f1;
  border: 1px solid #b2dfce;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  color: var(--color-success);
  font-weight: 500;
  margin-top: 4px;
}

/* ─── FORM ACTIONS ─── */
.form-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  margin-top: 32px;
  padding-top: 28px;
  border-top: 1px solid var(--color-bg);
}

/* ─── SUBMIT BUTTON ─── */
.btn-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  max-width: 340px;
  padding: 15px 32px;
  font-family: var(--font-base);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--color-white);
  background: linear-gradient(135deg, var(--color-blue) 0%, #0a93de 100%);
  border: none;
  border-radius: 50px;
  cursor: pointer;
  box-shadow: var(--shadow-btn);
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
  position: relative;
  overflow: hidden;
}

.btn-submit::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.15) 0%, transparent 60%);
  border-radius: inherit;
}

.btn-submit:hover {
  background: linear-gradient(135deg, var(--color-blue-dark) 0%, var(--color-blue) 100%);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(8, 125, 193, 0.45);
}

.btn-submit:active {
  transform: translateY(0);
  box-shadow: var(--shadow-btn);
}

.btn-submit:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 3px;
}

/* Loading state */
.btn-submit.loading {
  pointer-events: none;
  opacity: 0.8;
}

/* ─── SUBMIT NOTE ─── */
.submit-note {
  font-size: 0.78rem;
  color: var(--color-muted);
  text-align: center;
}

.link {
  color: var(--color-blue);
  text-decoration: none;
  font-weight: 600;
  border-bottom: 1px solid transparent;
  transition: border-color var(--transition), color var(--transition);
}

.link:hover {
  color: var(--color-accent);
  border-bottom-color: var(--color-accent);
}

/* ─── SITE FOOTER ─── */
.site-footer {
  background: var(--color-navy);
  color: rgba(255,255,255,0.55);
  text-align: center;
  padding: 18px 24px;
  font-size: 0.78rem;
  letter-spacing: 0.03em;
}

/* ═══════════════════════════════════════════════════
   RESPONSIVE BREAKPOINTS
═══════════════════════════════════════════════════ */

/* ── Tablet (≤ 640 px) ── */
@media (max-width: 640px) {
  .card {
    border-radius: var(--radius-md);
    border-left: none;
    border-right: none;
    box-shadow: 0 4px 16px rgba(7, 54, 107, 0.08);
  }

  .card-header,
  .passenger-form {
    padding-left: 20px;
    padding-right: 20px;
  }

  .card-header {
    padding-top: 24px;
    padding-bottom: 18px;
  }

  .card-header::after {
    left: 20px;
  }

  .card-title {
    font-size: 1.25rem;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .main-wrapper {
    padding: 24px 0 48px;
  }
}

/* ── Mobile (≤ 420 px) ── */
@media (max-width: 420px) {
  .brand-name {
    font-size: 1.2rem;
  }

  .form-control {
    font-size: 0.875rem;
    padding: 11px 14px 11px 42px;
  }

  .btn-submit {
    font-size: 0.9375rem;
    padding: 13px 24px;
  }
}

/* ── Large screens ── */
@media (min-width: 900px) {
  .header-inner {
    padding-top: 40px;
    padding-bottom: 36px;
  }

  .main-wrapper {
    padding-top: 56px;
  }
}
