:root {
  --bg-color: #fcf3ea;
  --card-bg: #ffffff;
  --border-color: rgba(58, 55, 44, 0.12);
  --primary-color: #0176c3;     /* Blue */
  --primary-glow: rgba(1, 118, 195, 0.15);
  --accent-green: #30ac66;     /* Green */
  --accent-gold: #fcab02;      /* Gold */
  --text-color: #3a372c;       /* Dark charcoal */
  --text-secondary: #65614d;
  --font-family: 'Space Grotesk', 'Plus Jakarta Sans', sans-serif;
  --shadow-subtle: 0 12px 40px rgba(58, 55, 44, 0.06);
  --shadow-button: 0 6px 20px rgba(1, 118, 195, 0.3);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-color);
  color: var(--text-color);
  font-family: var(--font-family);
  overflow-x: hidden;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
}

/* Decorative Brand Shapes */
.brand-shapes {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.shape {
  position: absolute;
  opacity: 0.8;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.04));
  animation: float 8s ease-in-out infinite alternate;
}

.shape-sparkle {
  width: 70px;
  height: 70px;
  top: 10%;
  left: 8%;
  animation-delay: 0s;
}

.shape-bolt {
  width: 60px;
  height: 60px;
  top: 15%;
  right: 10%;
  animation-delay: 2s;
}

.shape-crescent {
  width: 90px;
  height: 90px;
  bottom: 12%;
  left: 5%;
  animation-delay: 1s;
}

.shape-burst {
  width: 75px;
  height: 75px;
  bottom: 10%;
  right: 8%;
  animation-delay: 3s;
}

@keyframes float {
  0% { transform: translateY(0) rotate(0deg); }
  100% { transform: translateY(-15px) rotate(10deg); }
}

/* Main Container */
.container {
  width: 100%;
  max-width: 580px; /* Incrementado para acomodar 2 columnas cómodamente */
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  position: relative;
  z-index: 2;
}

/* Header */
.header {
  text-align: center;
}

.logo-wrapper {
  margin-bottom: 16px;
}

.brand-logo {
  height: 180px; /* Optimizado para evitar que empuje demasiado el contenido */
  max-width: 100%;
  object-fit: contain;
  filter: drop-shadow(0 4px 10px rgba(58, 55, 44, 0.12));
}

.badge {
  display: inline-block;
  background: rgba(48, 172, 102, 0.06);
  color: var(--accent-green);
  border: 1px solid rgba(48, 172, 102, 0.2);
  padding: 6px 14px;
  border-radius: 50px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}

.header h1 {
  font-size: 2.1rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}

.subtitle {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.5;
  font-weight: 400;
}

/* Card Container */
.glass-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 36px;
  box-shadow: var(--shadow-subtle);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.glass-card:hover {
  box-shadow: 0 15px 45px rgba(58, 55, 44, 0.1);
}

.card-header {
  margin-bottom: 24px;
  border-bottom: 1px solid rgba(58, 55, 44, 0.06);
  padding-bottom: 16px;
}

.card-header h2 {
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.card-header p {
  color: var(--text-secondary);
  font-size: 0.85rem;
}

/* Stepper Progress Indicator */
.stepper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
  padding: 0 10px;
}

.step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  position: relative;
  z-index: 2;
  transition: all 0.3s ease;
}

.step-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-color);
  border: 2px solid var(--border-color);
  display: flex;
  justify-content: center;
  align-items: center;
  font-weight: 700;
  color: var(--text-secondary);
  transition: all 0.3s ease;
}

.step.active .step-circle {
  background: var(--primary-color);
  border-color: var(--primary-color);
  color: #fff;
  box-shadow: 0 4px 12px var(--primary-glow);
}

.step.completed .step-circle {
  background: var(--accent-green);
  border-color: var(--accent-green);
  color: #fff;
}

.step-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.step.active .step-label, .step.completed .step-label {
  color: var(--text-color);
}

.step-line {
  flex-grow: 1;
  height: 2px;
  background: var(--border-color);
  margin: 0 10px;
  position: relative;
  top: -12px;
  transition: background 0.3s ease;
}

.step-line.active {
  background: var(--accent-green);
}

/* Form Steps */
.form-step {
  display: none;
  animation: slideIn 0.4s ease forwards;
}

.form-step.active {
  display: block;
}

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

/* Step Actions */
.step-actions {
  margin-top: 24px;
  display: flex;
  gap: 16px;
}

.step-actions.split {
  justify-content: space-between;
}

.btn-back {
  background: transparent;
  border: 2px solid var(--border-color);
  border-radius: 8px;
  padding: 12px 24px;
  color: var(--text-secondary);
  font-family: var(--font-family);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-back:hover {
  background: var(--bg-color);
  color: var(--text-color);
}


/* Form Grid Layout (UX/UI refinement) */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group.span-2 {
  grid-column: span 2;
}

label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-color);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Input Fields with Icons inside (UX Improvement) */
.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.input-wrapper input,
.input-wrapper select {
  width: 100%;
  background-color: #ffffff;
  border: 2px solid var(--border-color);
  border-radius: 8px;
  padding: 12px 16px 12px 46px; /* Padding izquierdo extra para acomodar icono */
  color: var(--text-color);
  font-family: var(--font-family);
  font-size: 0.95rem;
  outline: none;
  transition: all 0.25s ease;
}

.input-wrapper select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22%2365614d%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpolyline%20points%3D%226%209%2012%2015%2018%209%22%3E%3C%2Fpolyline%3E%3C%2Fsvg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  background-size: 16px;
  padding-right: 40px; /* Espacio extra a la derecha para la flecha */
}

.input-wrapper input:focus,
.input-wrapper select:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 4px var(--primary-glow);
}

.input-icon {
  position: absolute;
  left: 16px;
  width: 18px;
  height: 18px;
  color: var(--text-secondary);
  pointer-events: none;
  transition: color 0.25s ease;
}

.input-wrapper:focus-within .input-icon {
  color: var(--primary-color);
}

/* Suggested Package Chips (Sencillez de Compra) */
.ticket-selection-area {
  border-top: 1px solid rgba(58, 55, 44, 0.06);
  border-bottom: 1px solid rgba(58, 55, 44, 0.06);
  padding: 24px 0;
  margin: 24px 0;
}

.package-chips {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 12px;
  margin-top: 10px;
  margin-bottom: 16px;
}

.chip {
  background: #ffffff;
  border: 2px solid var(--border-color);
  border-radius: 10px;
  padding: 16px 10px;
  text-align: center;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4px;
  position: relative;
  transition: all 0.2s ease;
}

.chip:hover {
  border-color: var(--primary-color);
  transform: translateY(-1.5px);
}

.chip.active {
  background: var(--primary-color);
  border-color: var(--primary-color);
  color: #ffffff;
  box-shadow: 0 6px 16px rgba(1, 118, 195, 0.25);
}

.chip-title {
  font-weight: 700;
  font-size: 0.95rem;
}

.chip-price {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.chip.active .chip-price {
  color: rgba(255, 255, 255, 0.85);
}

.chip-badge {
  position: absolute;
  top: -10px;
  background: var(--accent-gold);
  color: #ffffff;
  font-size: 0.62rem;
  font-weight: 800;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 20px;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 6px rgba(252, 171, 2, 0.3);
}

.custom-qty-wrapper {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 16px;
}

.custom-qty-label {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-secondary);
}

/* Ticket Quantity Selector Stepper */
.ticket-selector {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #ffffff;
  border: 2px solid var(--border-color);
  border-radius: 8px;
  padding: 4px;
}

.btn-qty {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  border: none;
  background: rgba(58, 55, 44, 0.05);
  color: var(--text-color);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: all 0.2s;
}

.btn-qty:hover {
  background: var(--primary-color);
  color: #fff;
}

.btn-qty:active {
  transform: scale(0.95);
}

#ticket_count {
  width: 44px;
  border: none;
  background: transparent;
  color: var(--text-color);
  text-align: center;
  font-size: 1.15rem;
  font-weight: 700;
  outline: none;
}

.price-hint {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-top: 8px;
  display: block;
}

#unit-price {
  color: var(--primary-color);
  font-weight: 700;
}

/* Checkboxes Group */
.checkboxes-group {
  margin-bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: rgba(58, 55, 44, 0.02);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 16px;
}

.checkbox-container {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  position: relative;
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--text-secondary);
  user-select: none;
  line-height: 1.4;
}

.checkbox-container input {
  position: absolute;
  opacity: 0;
  cursor: pointer;
  height: 0;
  width: 0;
}

.checkmark {
  height: 18px;
  width: 18px;
  background-color: #ffffff;
  border: 2px solid var(--border-color);
  border-radius: 4px;
  flex-shrink: 0;
  position: relative;
  transition: all 0.2s;
  margin-top: 2px;
}

.checkbox-container:hover input ~ .checkmark {
  border-color: var(--primary-color);
}

.checkbox-container input:checked ~ .checkmark {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
}

.checkmark:after {
  content: "";
  position: absolute;
  display: none;
  left: 5px;
  top: 1px;
  width: 4px;
  height: 8px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.checkbox-container input:checked ~ .checkmark:after {
  display: block;
}

.legal-link {
  color: var(--primary-color);
  text-decoration: underline;
  font-weight: 700;
  transition: opacity 0.2s;
}

.legal-link:hover {
  opacity: 0.8;
}

/* Submit Button */
.btn-submit {
  width: 100%;
  background: var(--primary-color);
  border: none;
  border-radius: 8px;
  padding: 18px;
  color: #fff;
  font-family: var(--font-family);
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.25s ease;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow-button);
}

.btn-submit:hover:not(:disabled) {
  transform: translateY(-1.5px);
  background: #0162a3;
  box-shadow: 0 8px 24px rgba(1, 118, 195, 0.5);
}

.btn-submit:active:not(:disabled) {
  transform: translateY(0);
}

.btn-submit:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

/* Loading Spinner */
.spinner {
  width: 18px;
  height: 18px;
  border: 2.5px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #fff;
  animation: spin 1s linear infinite;
  display: inline-block;
  vertical-align: middle;
}

.hidden {
  display: none !important;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Error Box */
.error-box {
  background: rgba(255, 0, 127, 0.06);
  border: 1px solid rgba(255, 0, 127, 0.25);
  color: #ff007f;
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 0.85rem;
  margin-top: 16px;
  line-height: 1.4;
  text-align: left;
}

/* Footer */
.footer {
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-secondary);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.admin-link {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 700;
  transition: opacity 0.2s;
}

.admin-link:hover {
  opacity: 0.8;
}

/* Overlay Modals */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(58, 55, 44, 0.35);
  backdrop-filter: blur(6px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  padding: 20px;
  transition: all 0.3s ease;
}

.modal-content {
  background-color: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  max-width: 500px;
  width: 100%;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 15px 40px rgba(58, 55, 44, 0.12);
  animation: modal-enter 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modal-enter {
  from { transform: translateY(15px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.modal-header {
  padding: 18px 24px;
  border-bottom: 1px solid rgba(58, 55, 44, 0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  font-size: 1.15rem;
  font-weight: 800;
  margin: 0;
}

.close-modal {
  background: transparent;
  border: none;
  font-size: 1.6rem;
  color: var(--text-secondary);
  cursor: pointer;
  line-height: 1;
  transition: color 0.2s;
}

.close-modal:hover {
  color: #ff007f;
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-align: left;
}

.modal-body h4 {
  color: var(--text-color);
  font-size: 0.92rem;
  font-weight: 700;
  margin-top: 8px;
  margin-bottom: 2px;
}

.modal-body ul {
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid rgba(58, 55, 44, 0.08);
  display: flex;
  justify-content: flex-end;
}

.btn-modal-close {
  background: var(--primary-color);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 10px 18px;
  font-family: var(--font-family);
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-modal-close:hover {
  background: #0162a3;
}

/* Responsive adjustments */
@media (max-width: 580px) {
  .form-grid {
    grid-template-columns: 1fr;
    gap: 15px;
  }
  .form-group.span-2 {
    grid-column: span 1;
  }
  .glass-card {
    padding: 24px;
  }
  .header h1 {
    font-size: 1.8rem;
  }
  .shape {
    opacity: 0.04;
  }
}