/* Pilates — consultar / validar bono (coherente con styles.css) */

.bono-page {
  --bono-card-radius: 15px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--light-bg, #f8f9fa);
  transition: background 0.45s ease;
}

.bono-page--neutral {
  background: linear-gradient(160deg, #f8f9fa 0%, #eef4f7 50%, #f8f9fa 100%);
}

.bono-page--ok {
  background: linear-gradient(160deg, #e8f5ec 0%, #d4edda 40%, #eef4f7 100%);
}

.bono-page--warn {
  background: linear-gradient(160deg, #fdecea 0%, #f8d7da 45%, #f5eef0 100%);
}

.bono-page--form {
  background: var(--white, #fff);
}

.bono-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  background: var(--white, #fff);
  box-shadow: 0 4px 12px rgba(27, 73, 101, 0.08);
  position: sticky;
  top: 0;
  z-index: 100;
}

.bono-back {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--primary-color, #1b4965);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  transition: color 0.2s ease;
}

.bono-back:hover {
  color: var(--secondary-color, #5fa8d3);
}

.bono-logo img {
  height: 44px;
  width: auto;
  display: block;
}

.bono-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 1rem 2.5rem;
}

.bono-card {
  width: 100%;
  max-width: 440px;
  background: var(--white, #fff);
  border-radius: var(--bono-card-radius);
  box-shadow: var(--shadow, 0 10px 20px rgba(0, 0, 0, 0.1));
  padding: 2rem 1.75rem;
  text-align: center;
  border: 1px solid rgba(27, 73, 101, 0.08);
}

.bono-card__icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 1rem;
  border-radius: 50%;
  background: var(--gradient, linear-gradient(135deg, #1b4965, #62b6cb));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
}

.bono-card__title {
  font-size: 1.65rem;
  font-weight: 700;
  color: var(--primary-color, #1b4965);
  margin-bottom: 0.5rem;
  line-height: 1.25;
}

.bono-card__intro {
  font-size: 0.92rem;
  color: #5a6570;
  line-height: 1.55;
  margin: 0 0 1.25rem;
  text-align: left;
}

.bono-field label {
  display: block;
  text-align: left;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--primary-color, #1b4965);
  margin-bottom: 0.4rem;
}

.bono-field input[type="text"],
.bono-field input[type="password"],
.bono-field input[type="date"],
.bono-field select {
  width: 100%;
  padding: 0.85rem 1rem;
  margin-bottom: 1rem;
  font-size: 1rem;
  font-family: inherit;
  border-radius: 10px;
  border: 2px solid rgba(27, 73, 101, 0.15);
  background: #fff;
  color: var(--text-color, #333);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  box-sizing: border-box;
}

.bono-field input:focus,
.bono-field select:focus {
  outline: none;
  border-color: var(--secondary-color, #5fa8d3);
  box-shadow: 0 0 0 3px rgba(95, 168, 211, 0.25);
}

.bono-btn {
  width: 100%;
  padding: 0.95rem 1.25rem;
  font-size: 1.05rem;
  font-weight: 600;
  font-family: inherit;
  border-radius: 12px;
  cursor: pointer;
  border: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
  box-sizing: border-box;
}

.bono-btn--primary {
  background: var(--gradient, linear-gradient(135deg, #1b4965, #62b6cb));
  color: #fff;
  box-shadow: 0 4px 14px rgba(27, 73, 101, 0.25);
  margin-bottom: 0.75rem;
}

.bono-btn--primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(27, 73, 101, 0.3);
}

.bono-btn--secondary {
  background: var(--white, #fff);
  color: var(--primary-color, #1b4965);
  border: 2px solid var(--primary-color, #1b4965);
  margin-top: 0.5rem;
}

.bono-btn--secondary:hover:not(:disabled) {
  background: rgba(27, 73, 101, 0.05);
}

.bono-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
}

.bono-results {
  text-align: left;
  margin-top: 0.5rem;
}

.bono-saludo {
  margin: 0.75rem 0 0.35rem;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--primary-color, #1b4965);
  line-height: 1.35;
  text-align: left;
}

.bono-results p {
  margin: 0.5rem 0;
  font-size: 0.95rem;
  line-height: 1.45;
}

.bono-results #mensaje {
  font-weight: 500;
  color: var(--text-color, #333);
}

.bono-meta--accent {
  font-weight: 600;
  color: var(--primary-color, #1b4965) !important;
}

.bono-meta--ok {
  font-weight: 600;
  color: #2e7d4a !important;
}

.bono-meta--clases {
  font-weight: 600;
  color: #c45c00 !important;
}

.bono-form {
  display: none;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(27, 73, 101, 0.12);
  text-align: left;
}

.bono-form h2 {
  font-size: 1.25rem;
  color: var(--primary-color, #1b4965);
  margin-bottom: 1rem;
  text-align: center;
}

.bono-form label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--primary-color, #1b4965);
  margin: 0.75rem 0 0.35rem;
}

.bono-form input,
.bono-form select {
  width: 100%;
  padding: 0.75rem 1rem;
  margin-bottom: 0.5rem;
  font-size: 1rem;
  font-family: inherit;
  border-radius: 10px;
  border: 2px solid rgba(27, 73, 101, 0.15);
  box-sizing: border-box;
}

.bono-rating {
  display: flex;
  justify-content: center;
  gap: 0.25rem;
  font-size: 2rem;
  margin: 0.5rem 0 1rem;
}

.bono-rating .star {
  cursor: pointer;
  color: #d0d5db;
  transition: color 0.15s ease, transform 0.15s ease;
}

.bono-rating .star:hover {
  transform: scale(1.08);
}

.bono-rating .star.selected {
  color: #f5b942;
}

#alertaSistema {
  position: fixed;
  top: 5.5rem;
  left: 50%;
  transform: translateX(-50%);
  min-width: 280px;
  max-width: 92%;
  padding: 14px 16px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.92rem;
  box-shadow: 0 12px 28px rgba(27, 73, 101, 0.18);
  opacity: 0;
  z-index: 9999;
  transition: opacity 0.35s ease;
  display: flex;
  align-items: center;
  gap: 10px;
}

#alertaSistema.visible {
  opacity: 1;
}

#alertaSistema.visible #alertTexto {
  white-space: pre-line;
  line-height: 1.35;
}

#alertaSistema.alert-info {
  background: #e8f4fc;
  color: #1b4965;
  border: 1px solid rgba(95, 168, 211, 0.5);
}

#alertaSistema.alert-success {
  background: #e8f5ec;
  color: #1e5631;
  border: 1px solid #a8d5b5;
}

#alertaSistema.alert-error {
  background: #fdecea;
  color: #8b2635;
  border: 1px solid #f0b4bc;
}

#alertaSistema .cerrar {
  background: transparent;
  border: none;
  width: auto;
  margin: 0 0 0 auto;
  padding: 4px 8px;
  color: inherit;
  font-size: 1.1rem;
  cursor: pointer;
}

/* Explosión de confeti al consultar bono (éxito) */
.bono-confetti-burst {
  position: fixed;
  inset: 0;
  z-index: 10050;
  pointer-events: none;
  overflow: hidden;
}

.bono-confetti-burst__layer {
  position: absolute;
  inset: 0;
}

.bono-confetti-burst__flash {
  position: fixed;
  width: 24px;
  height: 24px;
  margin: -12px 0 0 -12px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.95) 0%, rgba(98, 182, 203, 0.5) 45%, transparent 70%);
  opacity: 0;
  transform: scale(0.2);
  pointer-events: none;
}

.bono-confetti-burst--play .bono-confetti-burst__flash {
  animation: bono-confetti-flash 0.45s ease-out forwards;
}

@keyframes bono-confetti-flash {
  0% {
    opacity: 0;
    transform: scale(0.2);
  }
  30% {
    opacity: 1;
    transform: scale(2.5);
  }
  100% {
    opacity: 0;
    transform: scale(4);
  }
}

.bono-confetti-burst__piece {
  position: fixed;
  width: var(--w, 9px);
  height: var(--h, 12px);
  margin-left: calc(var(--w, 9px) / -2);
  margin-top: calc(var(--h, 12px) / -2);
  background: hsl(var(--hue, 200), 88%, 52%);
  border-radius: 2px;
  opacity: 0;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
}

.bono-confetti-burst__piece--round {
  border-radius: 50%;
}

.bono-confetti-burst--play .bono-confetti-burst__piece {
  animation: bono-confetti-explode 1.15s cubic-bezier(0.12, 0.85, 0.25, 1) var(--delay, 0s) forwards;
}

@keyframes bono-confetti-explode {
  0% {
    opacity: 1;
    transform: translate(0, 0) rotate(0deg) scale(0.2);
  }
  8% {
    transform: translate(calc(var(--dx) * 0.15), calc(var(--dy) * 0.1)) rotate(calc(var(--rot) * 0.1)) scale(1.15);
  }
  100% {
    opacity: 0;
    transform: translate(var(--dx), var(--dy)) rotate(var(--rot)) scale(0.85);
  }
}

@media (prefers-reduced-motion: reduce) {
  .bono-confetti-burst {
    display: none !important;
  }
}

@media (max-width: 480px) {
  .bono-card {
    padding: 1.5rem 1.25rem;
  }

  .bono-card__title {
    font-size: 1.4rem;
  }
}
