/**
 * Estilos Principales
 * Sistema de Exoneraciones La Pista - Versión 2026
 * 
 * Estilos unificados para la parte del cliente (registro de ingreso)
 */

/* ============================================
   VARIABLES CSS
   ============================================ */
:root {
  --color-primary: #f90000;
  --color-secondary: #333333;
  --color-success: #28a745;
  --color-danger: #dc3545;
  --color-warning: #ffc107;
  --color-info: #17a2b8;
  --color-light: #f0f2f5;
  --color-border: #dee2e6;
  --color-text-muted: #6c757d;
}

/* ============================================
   ESTILOS GENERALES
   ============================================ */
body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  color: var(--color-secondary);
  background-color: var(--color-light);
  background-image: url("../img/fondo_pista02.webp");
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  background-repeat: no-repeat;
  min-height: 100vh;
  position: relative;
}

body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(240, 242, 245, 0.85);
  z-index: -1;
}

/* Utilidades responsive para textos */
@media (min-width: 768px) {
  .h2-md {
    font-size: 2rem;
  }

  .small-md {
    font-size: 1rem;
  }
}

/* Mejoras de espaciado responsive */
.step-section {
  margin-bottom: 1.5rem;
}

@media (min-width: 768px) {
  .step-section {
    margin-bottom: 2rem;
  }
}

@media (min-width: 992px) {
  .step-section {
    margin-bottom: 2.5rem;
  }
}

/* ============================================
   UTILIDADES Y CLASES PERSONALIZADAS
   ============================================ */
.text-primary-custom {
  color: var(--color-primary) !important;
}

.bg-primary-custom {
  background-color: var(--color-primary) !important;
}

.btn-primary-custom {
  background-color: var(--color-primary);
  border-color: var(--color-primary);
  color: white;
  transition:
    background-color 0.3s ease,
    border-color 0.3s ease;
}

.btn-primary-custom:hover {
  background-color: #d80000;
  border-color: #d80000;
  color: white;
}

/* ============================================
   SWEETALERT2 CUSTOMIZATION
   ============================================ */
.swal2-styled.swal2-confirm {
  background-color: var(--color-primary) !important;
  border-color: var(--color-primary) !important;
}

.swal2-styled.swal2-confirm:hover {
  background-color: #d80000 !important;
  border-color: #d80000 !important;
}

.swal2-styled.swal2-cancel {
  background-color: var(--color-secondary) !important;
  border-color: var(--color-secondary) !important;
}

.swal2-styled.swal2-cancel:hover {
  background-color: #222222 !important;
  border-color: #222222 !important;
}

.swal2-popup {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif !important;
}

.btn-primary-custom:focus {
  box-shadow: 0 0 0 0.2rem rgba(249, 0, 0, 0.25);
}

/* ============================================
   LAYOUT Y CONTENEDORES
   ============================================ */
.container-fluid {
  width: 100%;
  padding-left: 0.75rem;
  padding-right: 0.75rem;
}

@media (min-width: 576px) {
  .container-fluid {
    padding-left: 1rem;
    padding-right: 1rem;
  }
}

@media (min-width: 768px) {
  .container-fluid {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
}

@media (min-width: 992px) {
  .container-fluid {
    padding-left: 2rem;
    padding-right: 2rem;
    max-width: 100%;
  }
}

@media (min-width: 1200px) {
  .container-fluid {
    padding-left: 2.5rem;
    padding-right: 2.5rem;
    max-width: 100%;
  }
}

@media (min-width: 1400px) {
  .container-fluid {
    padding-left: 3rem;
    padding-right: 3rem;
  }
}

.card {
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.15);
  border: none;
  width: 100%;
  max-width: 100%;
  background-color: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(10px);
}

@media (min-width: 768px) {
  .card {
    border-radius: 15px;
    box-shadow: 0 0.75rem 2rem rgba(0, 0, 0, 0.2);
  }
}

@media (min-width: 992px) {
  .card {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    max-width: 1400px;
    margin: 0 auto;
  }
}

@media (min-width: 1200px) {
  .card {
    max-width: 1600px;
  }
}

@media (min-width: 1400px) {
  .card {
    max-width: 1800px;
  }
}

@media (min-width: 1200px) {
  .card {
    max-width: 1400px;
  }
}

@media (min-width: 1400px) {
  .card {
    max-width: 1600px;
  }
}

.card-header {
  background-color: var(--color-danger);
  color: white;
  padding: 20px;
  border-bottom: none;
}

.card-title {
  margin-bottom: 0;
  font-weight: bold;
}

.card-body {
  padding: 1.25rem;
}

@media (min-width: 576px) {
  .card-body {
    padding: 1.5rem;
  }
}

@media (min-width: 768px) {
  .card-body {
    padding: 2rem;
  }
}

@media (min-width: 992px) {
  .card-body {
    padding: 2.5rem;
  }
}

@media (min-width: 1200px) {
  .card-body {
    padding: 3rem;
  }
}

/* Animación para mostrar formulario completo */
#formularioCompleto {
  animation: fadeIn 0.4s ease-in;
}

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

/* Documento verificado - Texto grande */
.documento-verificado {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.documento-verificado h2 {
  font-size: 2rem;
  letter-spacing: 0.5px;
}

@media (min-width: 768px) {
  .documento-verificado h2 {
    font-size: 2.5rem;
  }
}

@media (min-width: 992px) {
  .documento-verificado h2 {
    font-size: 3rem;
  }
}

#tipoDocMostrado {
  display: block;
  font-size: 0.6em;
  font-weight: 400;
  margin-bottom: 0.5rem;
}

@media (min-width: 768px) {
  #tipoDocMostrado {
    display: inline;
    margin-right: 1rem;
    margin-bottom: 0;
  }
}

#numeroDocMostrado {
  color: var(--color-secondary);
  font-family: "Courier New", monospace;
  letter-spacing: 2px;
}

/* Logo en el header */
.logo-container {
  display: flex;
  justify-content: center;
  align-items: center;
}

.logo-header {
  max-width: 200px;
  height: auto;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
  transition: transform 0.3s ease;
}

.logo-header:hover {
  transform: scale(1.05);
}

@media (min-width: 768px) {
  .logo-header {
    max-width: 250px;
  }
}

@media (min-width: 992px) {
  .logo-header {
    max-width: 300px;
  }
}

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

.form-control,
.form-select {
  border-radius: 5px;
  transition:
    border-color 0.15s ease-in-out,
    box-shadow 0.15s ease-in-out;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 0.2rem rgba(249, 0, 0, 0.25);
}

/* Campo de edad readonly */
.form-control[readonly] {
  background-color: #e9ecef;
  cursor: not-allowed;
  opacity: 1;
}

/* Campos con validación en tiempo real */
.form-control.is-valid {
  border-color: var(--color-success);
  padding-right: calc(1.5em + 0.75rem);
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' 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);
}

.form-control.is-invalid {
  border-color: var(--color-danger);
  padding-right: calc(1.5em + 0.75rem);
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23dc3545'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath 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);
}

/* Neutralizar el resaltado de autocompletado de Chrome/Safari */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
  -webkit-box-shadow: 0 0 0 30px white inset !important;
  -webkit-text-fill-color: var(--color-secondary) !important;
}

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

.valid-feedback {
  display: block;
  width: 100%;
  margin-top: 0.25rem;
  font-size: 0.875em;
  color: var(--color-success);
}

/* Secciones del formulario */
fieldset {
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 15px;
  margin-bottom: 20px;
}

legend {
  width: auto;
  padding: 0 10px;
  font-size: 1.1em;
  font-weight: bold;
  color: var(--color-danger);
  border-bottom: none;
}

/* ============================================
   FIRMA DIGITAL
   ============================================ */
.signature-pad-container,
.signature-canvas-container {
  background-color: #fff;
  border: 2px solid var(--color-border);
  border-radius: 8px;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
  padding: 15px;
  margin-bottom: 10px;
  transition: border-color 0.3s ease;
  width: 100%;
  overflow: hidden;
  position: relative;
}

.signature-canvas-container:focus-within {
  border-color: var(--color-primary);
}

#signatureCanvas {
  width: 100%;
  touch-action: none; /* Mejorar experiencia táctil */
  background-color: #fff;
  touch-action: none;
  cursor: crosshair;
  display: block;
  width: 100%;
  height: auto;
  border-radius: 5px;
}

/* ============================================
   EXONERACIÓN DE RESPONSABILIDAD
   ============================================ */
.exoneracion-container {
  background-color: #f8f9fa;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 1.5rem;
}

.exoneracion-content {
  max-height: 400px;
  overflow-y: auto;
  padding-right: 10px;
  margin-bottom: 1rem;
}

.exoneracion-content::-webkit-scrollbar {
  width: 8px;
}

.exoneracion-content::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 10px;
}

.exoneracion-content::-webkit-scrollbar-thumb {
  background: var(--color-primary);
  border-radius: 10px;
}

.exoneracion-content::-webkit-scrollbar-thumb:hover {
  background: #d80000;
}

.exoneracion-list {
  margin: 0;
  padding-left: 1.5rem;
  line-height: 1.8;
}

.exoneracion-list li {
  margin-bottom: 1rem;
  color: var(--color-secondary);
}

.exoneracion-list li:last-child {
  margin-bottom: 0;
}

/* ============================================
   BOTONES
   ============================================ */
.btn {
  border-radius: 5px;
  font-weight: 500;
  transition: all 0.3s ease;
}

.btn-primary {
  background-color: #007bff;
  border-color: #007bff;
}

.btn-success {
  background-color: var(--color-success);
  border-color: var(--color-success);
}

.btn-warning {
  background-color: var(--color-warning);
  border-color: var(--color-warning);
  color: #212529;
}

.btn-info {
  background-color: var(--color-info);
  border-color: var(--color-info);
}

.btn-outline-secondary {
  border-color: var(--color-border);
  color: var(--color-secondary);
}

.btn-outline-secondary:hover {
  background-color: var(--color-secondary);
  border-color: var(--color-secondary);
  color: white;
}

/* ============================================
   ALERTAS Y MENSAJES
   ============================================ */
.alert {
  border-radius: 5px;
  padding: 0.75rem 1rem;
}

.alert-success {
  background-color: #d4edda;
  border-color: #c3e6cb;
  color: #155724;
}

.alert-danger {
  background-color: #f8d7da;
  border-color: #f5c6cb;
  color: #721c24;
}

.alert-info {
  background-color: #d1ecf1;
  border-color: #bee5eb;
  color: #0c5460;
}

.alert-warning {
  background-color: #fff3cd;
  border-color: #ffeaa7;
  color: #856404;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 575.98px) {
  .card-body {
    padding: 1rem;
  }

  .step-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .step-header h5 {
    margin-top: 0;
    margin-left: 0 !important;
    font-size: 0.95rem;
  }

  .step-number {
    width: 32px;
    height: 32px;
    font-size: 0.9rem;
  }

  .exoneracion-content {
    max-height: 250px;
    font-size: 0.85rem;
    padding: 1rem;
  }

  .exoneracion-list {
    padding-left: 1.1rem;
    line-height: 1.6;
  }

  .exoneracion-list li {
    margin-bottom: 0.75rem;
  }

  #signatureCanvas {
    height: 150px;
  }

  .btn-lg {
    font-size: 0.95rem;
    padding: 0.65rem 1.25rem;
  }

  .form-label {
    font-size: 0.9rem;
  }

  .step-section {
    margin-bottom: 1.5rem;
  }
}

@media (min-width: 576px) and (max-width: 767.98px) {
  .exoneracion-content {
    max-height: 320px;
    font-size: 0.9rem;
  }

  #signatureCanvas {
    height: 180px;
  }

  .btn-lg {
    font-size: 1rem;
    padding: 0.75rem 1.5rem;
  }
}

@media (min-width: 768px) {
  #signatureCanvas {
    height: 200px;
  }

  .step-section {
    margin-bottom: 2rem;
  }
}

@media (min-width: 992px) {
  #signatureCanvas {
    height: 220px;
  }

  .card {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
  }
}

@media (min-width: 1200px) {
  #signatureCanvas {
    height: 240px;
  }
}
