/* ========================================
   PyCon Panamá 2025 - Estilos del Formulario
   ======================================== */

/* === Variables de Color === */
:root {
  --primary-color: #4a90e2;
  --primary-hover: #357abd;
  --secondary-color: #2c3e50;
  --success-color: #28a745;
  --danger-color: #dc3545;
  --warning-color: #ffc107;
  --info-color: #17a2b8;
  --light-bg: #f5f7fa;
  --border-color: #e0e0e0;
  --shadow-light: 0 2px 8px rgba(0, 0, 0, 0.05);
  --shadow-medium: 0 4px 12px rgba(0, 0, 0, 0.1);
  --transition-base: all 0.3s ease;
}

/* === Form Controls === */
.form-control:focus,
.custom-control-input:focus ~ .custom-control-label::before {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 0.2rem rgba(74, 144, 226, 0.25);
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

.custom-control-input:checked ~ .custom-control-label::before {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
}

.form-control {
  transition: var(--transition-base);
}

.form-control:hover:not(:focus) {
  border-color: #adb5bd;
}

/* === Labels === */
.form-group label {
  font-weight: 500;
  color: var(--secondary-color);
  margin-bottom: 0.5rem;
}

.form-group label .text-danger {
  font-size: 1.1em;
}

/* === Section Styling === */
.section-muted {
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  position: relative;
  overflow: hidden;
  max-width: 100% !important;
}

.section-muted::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary-color), var(--info-color));
}

/* === Ajuste de contenedor principal === */
#tickets-page {
  max-width: 1400px;
  margin: 0 auto;
}

/* === Ajuste de columnas === */
#tickets-page .row {
  margin-left: -20px;
  margin-right: -20px;
}

#tickets-page .row > [class*="col-"] {
  padding-left: 20px;
  padding-right: 20px;
}

/* === Fieldsets === */
fieldset {
  border: 2px solid var(--border-color);
  padding: 1.5rem;
  border-radius: 0.75rem;
  background: #fafbfc;
  transition: var(--transition-base);
}

fieldset:hover {
  border-color: var(--primary-color);
  background: #ffffff;
}

fieldset legend {
  width: auto;
  padding: 0 0.75rem;
  margin-bottom: 0.75rem;
  color: var(--secondary-color);
  font-weight: 600;
  font-size: 1.1rem;
  float: none;
}

/* === Buttons === */
.btn-primary {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
  padding: 0.75rem 2rem;
  font-weight: 600;
  font-size: 1.1rem;
  transition: var(--transition-base);
  position: relative;
  overflow: hidden;
}

.btn-primary:hover,
.btn-primary:focus {
  background-color: var(--primary-hover);
  border-color: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(74, 144, 226, 0.4);
}

.btn-primary:active {
  transform: translateY(0);
}

/* Efecto de onda en el botón */
.btn-primary::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.btn-primary:active::after {
  width: 300px;
  height: 300px;
}

/* === Info Card === */
.info-card {
  background: white;
  border-left: 5px solid var(--primary-color);
  padding: 1.75rem;
  border-radius: 0.75rem;
  box-shadow: var(--shadow-medium);
  margin-bottom: 2rem;
  transition: var(--transition-base);
}

.info-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.info-card h1,
.info-card h2 {
  color: var(--secondary-color);
  margin-bottom: 1rem;
}

/* === Date Location Items === */
.date-location-item {
  padding: 0.75rem;
  border-bottom: 1px solid #f0f0f0;
  transition: var(--transition-base);
}

.date-location-item:last-child {
  border-bottom: none;
}

.date-location-item:hover {
  background: #f8f9fa;
  padding-left: 1rem;
}

.date-location-item strong {
  color: var(--secondary-color);
  display: block;
  margin-bottom: 0.25rem;
}

.date-location-item small {
  color: #6c757d;
}

/* === Required Note === */
.required-note {
  font-size: 0.875rem;
  color: var(--danger-color);
  font-weight: 500;
  display: inline-block;
  padding: 0.25rem 0.5rem;
  background: #fff5f5;
  border-radius: 0.25rem;
}

/* === Feedback Messages === */
.success-feedback,
.error-feedback {
  padding: 1rem 1.25rem;
  border-radius: 0.5rem;
  margin-bottom: 1.5rem;
  font-weight: 500;
  animation: slideDown 0.4s ease;
  display: none;
}

.success-feedback {
  background: #d4edda;
  color: #155724;
  border: 2px solid #c3e6cb;
}

.error-feedback {
  background: #f8d7da;
  color: #721c24;
  border: 2px solid #f5c6cb;
}

.success-feedback.show,
.error-feedback.show {
  display: block;
}

/* === Progress Bar === */
.form-progress {
  height: 6px;
  background: #e9ecef;
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 1.5rem;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.form-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--primary-color), var(--info-color));
  width: 0%;
  transition: width 0.5s ease;
  box-shadow: 0 0 10px rgba(74, 144, 226, 0.5);
}

/* === Registration Code Box === */
.registration-code-box {
  background: linear-gradient(135deg, #fff9e6 0%, #fff3cd 100%);
  border: 2px dashed var(--warning-color);
  padding: 1.25rem;
  border-radius: 0.75rem;
  text-align: center;
  margin-bottom: 1.25rem;
  transition: var(--transition-base);
}

.registration-code-box:hover {
  background: #fff3cd;
  border-style: solid;
  box-shadow: 0 4px 12px rgba(255, 193, 7, 0.2);
}

.registration-code-box strong {
  font-size: 1.2rem;
  color: #856404;
  font-family: 'Courier New', monospace;
  letter-spacing: 1px;
  display: inline-block;
  padding: 0.5rem 1rem;
  background: white;
  border-radius: 0.5rem;
  margin: 0.5rem 0;
}

.registration-code-box .small {
  color: #856404;
  font-weight: 500;
}

/* === Custom Checkboxes Enhancement === */
.custom-control-label {
  cursor: pointer;
  user-select: none;
  transition: var(--transition-base);
}

.custom-control-label:hover {
  color: var(--primary-color);
}

.custom-control-input:checked ~ .custom-control-label {
  color: var(--primary-color);
  font-weight: 500;
}

/* === Validation States === */
.form-control.is-invalid {
  border-color: var(--danger-color);
  padding-right: calc(1.5em + 0.75rem);
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%23dc3545' viewBox='0 0 12 12'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23dc3545' stroke='none'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right calc(0.375em + 0.1875rem) center;
  background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

.form-control.is-valid {
  border-color: var(--success-color);
  padding-right: calc(1.5em + 0.75rem);
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' viewBox='0 0 8 8'%3e%3cpath fill='%2328a745' d='M2.3 6.73L.6 4.53c-.4-1.04.46-1.4 1.1-.8l1.1 1.4 3.4-3.8c.6-.63 1.6-.27 1.2.7l-4 4.6c-.43.5-.8.4-1.1.1z'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right calc(0.375em + 0.1875rem) center;
  background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

.invalid-feedback {
  display: none;
  width: 100%;
  margin-top: 0.25rem;
  font-size: 0.875rem;
  color: var(--danger-color);
  font-weight: 500;
}

.invalid-feedback.d-block {
  display: block !important;
}

/* === Animations === */
@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(74, 144, 226, 0.7);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(74, 144, 226, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(74, 144, 226, 0);
  }
}

/* === Tooltips / Helper Text === */
.form-text {
  font-size: 0.875rem;
  color: #6c757d;
  margin-top: 0.25rem;
}

/* === Loading State === */
.btn-primary.loading {
  pointer-events: none;
  opacity: 0.7;
  position: relative;
}

.btn-primary.loading::before {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  top: 50%;
  left: 50%;
  margin-left: -8px;
  margin-top: -8px;
  border: 2px solid #ffffff;
  border-radius: 50%;
  border-top-color: transparent;
  animation: spinner 0.6s linear infinite;
}

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

/* === Responsive Design === */
@media (max-width: 992px) {
  .info-card {
    margin-bottom: 2rem;
  }
}

@media (max-width: 768px) {
  fieldset {
    padding: 1rem;
  }

  .registration-code-box strong {
    font-size: 1rem;
  }

  .btn-primary {
    padding: 0.65rem 1.5rem;
    font-size: 1rem;
  }

  .info-card {
    padding: 1.25rem;
  }
}

@media (max-width: 576px) {
  fieldset legend {
    font-size: 1rem;
  }

  .form-control {
    font-size: 16px; /* Previene zoom en iOS */
  }

  .registration-code-box strong {
    font-size: 0.9rem;
    letter-spacing: 0.5px;
  }
}

/* === Print Styles === */
@media print {
  .btn-primary,
  .form-progress,
  .registration-code-box {
    display: none;
  }

  .info-card,
  fieldset {
    border: 1px solid #000;
    box-shadow: none;
  }
}

/* === Accessibility Enhancements === */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* High contrast mode */
@media (prefers-contrast: high) {
  .form-control,
  fieldset,
  .btn-primary {
    border-width: 2px;
  }
}

/* === Focus Visible (modernos navegadores) === */
.form-control:focus-visible,
.btn-primary:focus-visible,
.custom-control-input:focus-visible ~ .custom-control-label::before {
  outline: 3px solid var(--primary-color);
  outline-offset: 2px;
}

/* === Dark Mode Support (opcional) === */
@media (prefers-color-scheme: dark) {
  /* Puedes agregar estilos dark mode aquí si lo deseas */
}


/* ========================================
   AJUSTES DE ESPACIADO Y ANCHO
   Agregar al final de registro.css
   ======================================== */

/* === Contenedor principal más ancho === */
.container-fluid main {
  max-width: 100%;
  padding-left: 20px;
  padding-right: 20px;
}

/* === Aumentar ancho máximo del contenedor === */
main .col-xl-11 {
  max-width: 95%;
  flex: 0 0 95%;
}

@media (min-width: 1400px) {
  main .col-xl-11 {
    max-width: 90%;
    flex: 0 0 90%;
  }
}

@media (min-width: 1600px) {
  main .col-xl-11 {
    max-width: 85%;
    flex: 0 0 85%;
  }
}

/* === Mejor distribución de columnas === */
@media (min-width: 992px) {
  .col-lg-4 {
    flex: 0 0 35%;
    max-width: 35%;
  }
  
  .col-lg-8 {
    flex: 0 0 65%;
    max-width: 65%;
  }
}

@media (min-width: 1200px) {
  .col-lg-4 {
    flex: 0 0 33%;
    max-width: 33%;
  }
  
  .col-lg-8 {
    flex: 0 0 67%;
    max-width: 67%;
  }
}

/* === Espaciado interno mejorado === */
#tickets-page {
  padding: 2.5rem !important;
}

@media (min-width: 768px) {
  #tickets-page {
    padding: 3rem !important;
  }
}

@media (min-width: 1200px) {
  #tickets-page {
    padding: 4rem !important;
  }
}

/* === Formulario con más espacio === */
.bg-white.shadow {
  padding: 2rem !important;
}

@media (min-width: 768px) {
  .bg-white.shadow {
    padding: 2.5rem !important;
  }
}

@media (min-width: 1200px) {
  .bg-white.shadow {
    padding: 3rem !important;
  }
}

/* === Info card con mejor padding === */
.info-card {
  padding: 2rem !important;
}

@media (min-width: 768px) {
  .info-card {
    padding: 2.5rem !important;
  }
}

/* === Fieldsets más amplios === */
fieldset {
  padding: 1.5rem !important;
  margin-bottom: 1.75rem;
}

@media (min-width: 768px) {
  fieldset {
    padding: 2rem !important;
  }
}

/* === Form groups con mejor espaciado === */
.form-group {
  margin-bottom: 1.5rem;
}

/* === Checkboxes más espaciados === */
.custom-control {
  margin-bottom: 1rem;
  padding-left: 2rem;
}

.custom-control-label {
  padding-left: 0.5rem;
  line-height: 1.6;
}

/* === Registration code box más grande === */
.registration-code-box {
  padding: 1.75rem !important;
  margin: 1.5rem 0;
}

@media (min-width: 768px) {
  .registration-code-box {
    padding: 2.25rem !important;
  }
}

.registration-code-box strong {
  font-size: 1.35rem !important;
  padding: 0.75rem 1.5rem !important;
}

@media (min-width: 768px) {
  .registration-code-box strong {
    font-size: 1.5rem !important;
  }
}

/* === Botón submit más prominente === */
.btn-lg {
  padding: 1rem 2.5rem !important;
  font-size: 1.15rem !important;
}

@media (min-width: 768px) {
  .btn-lg {
    padding: 1.125rem 3rem !important;
    font-size: 1.25rem !important;
  }
}

/* === Date location items más espaciados === */
.date-location-item {
  padding: 1rem 0;
  margin-bottom: 0.5rem;
}

/* === Alert con mejor padding === */
.alert {
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
}

/* === Form progress bar más visible === */
.form-progress {
  height: 8px;
  margin-bottom: 2rem;
}

/* === Legends más destacadas === */
fieldset legend {
  font-size: 1.15rem;
  padding: 0 1rem;
  margin-bottom: 1rem;
}

@media (min-width: 768px) {
  fieldset legend {
    font-size: 1.25rem;
  }
}

/* === Mejor espaciado en filas de formulario === */
.form-row {
  margin-left: -10px;
  margin-right: -10px;
}

.form-row > .col,
.form-row > [class*="col-"] {
  padding-left: 10px;
  padding-right: 10px;
}

@media (min-width: 768px) {
  .form-row {
    margin-left: -15px;
    margin-right: -15px;
  }

  .form-row > .col,
  .form-row > [class*="col-"] {
    padding-left: 15px;
    padding-right: 15px;
  }
}

/* === Ajuste para pantallas muy grandes === */
@media (min-width: 1920px) {
  main .col-xl-11 {
    max-width: 80%;
    flex: 0 0 80%;
  }

  #tickets-page {
    padding: 5rem !important;
  }

  .bg-white.shadow {
    padding: 4rem !important;
  }
}

/* === Eliminar espaciado excesivo en móvil === */
@media (max-width: 576px) {
  #tickets-page {
    padding: 1.5rem !important;
  }

  .bg-white.shadow {
    padding: 1.5rem !important;
  }

  fieldset {
    padding: 1.25rem !important;
  }

  .form-control,
  .custom-select {
    padding: 0.625rem 0.875rem;
  }

  .registration-code-box {
    padding: 1.25rem !important;
  }

  .registration-code-box strong {
    font-size: 1.1rem !important;
    padding: 0.5rem 1rem !important;
  }
}