/* =============================================
   REDISEÑO — view-reserve & view-confirmed
   Estilo: claro, minimalista, cercano
   ============================================= */

/* ── Vista reserva ── */
#view-reserve .home-center {
  padding: 12px 16px calc(24px + var(--safe-bottom, 0px));
  align-items: center;
  justify-content: safe center;
}

.reserve-wrap {
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* Cabecera del formulario */
.reserve-header {
  margin-bottom: 24px;
}

.reserve-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 6px;
}

.reserve-eyebrow svg {
  flex-shrink: 0;
}

.reserve-title {
  font-size: clamp(1.3rem, 5vw, 1.7rem);
  font-weight: 900;
  color: var(--text);
  margin: 0 0 4px;
  line-height: 1.15;
}

.reserve-subtitle {
  font-size: 0.88rem;
  color: var(--muted);
  margin: 0;
  line-height: 1.5;
}

/* Tarjeta de asiento individual */
.reserve-card {
  background: var(--card);
  border-radius: 20px;
  box-shadow: 0 2px 16px rgba(17,24,39,.07), 0 1px 4px rgba(17,24,39,.05);
  padding: 20px;
  margin-bottom: 12px;
  border: 1.5px solid rgba(17,24,39,.06);
  transition: box-shadow .2s ease;
}

.reserve-card:focus-within {
  box-shadow: 0 4px 24px rgba(44,123,229,.12), 0 1px 4px rgba(17,24,39,.05);
  border-color: rgba(44,123,229,.25);
}

.reserve-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.reserve-seat-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--brandA), var(--brandB));
  border: 1.5px solid rgba(44,123,229,.18);
  flex-shrink: 0;
}

.reserve-seat-badge svg {
  width: 20px;
  height: 20px;
  color: var(--primary);
}

.reserve-seat-label {
  font-size: 1rem;
  font-weight: 900;
  color: var(--text);
  line-height: 1.1;
}

.reserve-seat-sub {
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 500;
  margin-top: 1px;
}

.reserve-fields {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

@media (min-width: 480px) {
  .reserve-fields {
    grid-template-columns: 1fr 1fr;
  }
}

.reserve-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.reserve-field-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: #374151;
  letter-spacing: .02em;
  text-transform: uppercase;
}

.reserve-field input {
  width: 100%;
  border: 1.5px solid #e5e7eb;
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 0.97rem;
  background: #f9fafb;
  color: var(--text);
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
  line-height: 1.3;
  font-family: inherit;
}

.reserve-field input:focus {
  border-color: #93c5fd;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(59,130,246,.12);
}

.reserve-field input.field-error {
  border-color: #f87171;
  background: #fff5f5;
  box-shadow: 0 0 0 4px rgba(239,68,68,.10);
  animation: shake .3s ease;
}

.reserve-field input.field-error::placeholder {
  color: #fca5a5;
}

@keyframes shake {
  0%,100% { transform: translateX(0); }
  25%      { transform: translateX(-5px); }
  75%      { transform: translateX(5px); }
}

.reserve-field input::placeholder {
  color: #c4c9d4;
}

/* Autocomplete de pasajeros (solo staff logueado) */
.reserve-autocomplete-wrap {
  position: relative;
}

.reserve-autocomplete-list {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 20;
  background: #fff;
  border: 1.5px solid #e5e7eb;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(17,24,39,.12);
  max-height: 220px;
  overflow-y: auto;
  padding: 4px;
}

.reserve-autocomplete-item {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 10px;
  border: none;
  background: none;
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
}

.reserve-autocomplete-item:hover,
.reserve-autocomplete-item.active {
  background: #eff6ff;
}

.reserve-autocomplete-name {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.reserve-autocomplete-ci {
  font-size: 0.78rem;
  color: var(--muted);
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}

/* Acciones del formulario */
.reserve-actions {
  display: flex;
  gap: 10px;
  justify-content: space-between;
  margin-top: 8px;
  padding-top: 4px;
}

.reserve-actions .btn {
  border-radius: 999px;
  min-height: 48px;
  font-size: 0.95rem;
  font-weight: 800;
}

.reserve-actions .btn.success {
  flex: 1;
}

/* ── Vista confirmación ── */
#view-confirmed .home-center {
  padding: 16px 16px calc(24px + var(--safe-bottom, 0px));
  align-items: center;
  justify-content: safe center;
}

.confirmed-wrap {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  text-align: center;
}

/* Ícono central animado */
.confirmed-icon-wrap {
  position: relative;
  width: 88px;
  height: 88px;
  margin: 0 auto 20px;
}

.confirmed-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, #d1fae5, #a7f3d0);
  animation: ring-pop .5s cubic-bezier(.34,1.56,.64,1) forwards;
  opacity: 0;
}

.confirmed-check {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: check-in .4s cubic-bezier(.34,1.56,.64,1) .15s forwards;
  opacity: 0;
}

.confirmed-check svg {
  width: 44px;
  height: 44px;
  color: #059669;
}

.confirmed-check svg path {
  stroke-dasharray: 60;
  stroke-dashoffset: 60;
  animation: draw-check .4s ease .3s forwards;
}

@keyframes ring-pop {
  0%   { transform: scale(.4); opacity: 0; }
  100% { transform: scale(1);  opacity: 1; }
}

@keyframes check-in {
  0%   { opacity: 0; transform: scale(.6); }
  100% { opacity: 1; transform: scale(1); }
}

@keyframes draw-check {
  to { stroke-dashoffset: 0; }
}

/* Título y subtítulo */
.confirmed-title {
  font-size: clamp(1.4rem, 5.5vw, 1.9rem);
  font-weight: 900;
  color: var(--text);
  margin: 0 0 6px;
  line-height: 1.15;
  animation: fade-up .4s ease .4s both;
}

.confirmed-sub {
  font-size: 0.9rem;
  color: var(--muted);
  margin: 0 0 24px;
  line-height: 1.5;
  animation: fade-up .4s ease .5s both;
}

@keyframes fade-up {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Tarjetas de asientos confirmados */
.confirmed-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
  text-align: left;
}

.confirmed-card {
  background: var(--card);
  border-radius: 16px;
  border: 1.5px solid rgba(16,185,129,.18);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: 0 2px 12px rgba(16,185,129,.08);
  animation: card-slide .35s cubic-bezier(.34,1.56,.64,1) both;
}

.confirmed-card:nth-child(1) { animation-delay: .5s; }
.confirmed-card:nth-child(2) { animation-delay: .6s; }
.confirmed-card:nth-child(3) { animation-delay: .7s; }
.confirmed-card:nth-child(4) { animation-delay: .8s; }
.confirmed-card:nth-child(5) { animation-delay: .9s; }
.confirmed-card:nth-child(n+6) { animation-delay: .95s; }

@keyframes card-slide {
  from { opacity: 0; transform: translateY(16px) scale(.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.confirmed-card-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, #d1fae5, #a7f3d0);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.confirmed-card-icon svg {
  width: 18px;
  height: 18px;
  color: #059669;
}

.confirmed-card-info {
  flex: 1;
  min-width: 0;
}

.confirmed-card-num {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .06em;
  line-height: 1;
  margin-bottom: 2px;
}

.confirmed-card-name {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Hint de captura */
.confirmed-hint {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  color: var(--muted);
  background: #f3f4f6;
  border-radius: 999px;
  padding: 7px 14px;
  margin-bottom: 20px;
  animation: fade-up .4s ease .95s both;
}

/* Acciones */
.confirmed-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  animation: fade-up .4s ease 1s both;
}

.confirmed-actions .btn {
  border-radius: 999px;
  min-height: 48px;
  font-weight: 800;
  font-size: 0.95rem;
}

/* Confeti — canvas */
#confetti-canvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 999;
}

/* Reducir motion */
@media (prefers-reduced-motion: reduce) {
  .confirmed-ring,
  .confirmed-check,
  .confirmed-check svg path,
  .confirmed-title,
  .confirmed-sub,
  .confirmed-card,
  .confirmed-hint,
  .confirmed-actions {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
    stroke-dashoffset: 0 !important;
  }
}
