:root {
  --primary: #2c3e50;
  --secondary: #7f8c8d;
  --accent: #34495e;
  --success: #27ae60;
  --info: #2980b9;
  --danger: #c0392b;
  --light: #ecf0f1;
  --dark: #212529;
  --glass-bg: rgba(255, 255, 255, 0.8);
  --glass-border: rgba(255, 255, 255, 0.3);
  --sidebar-w: 260px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  min-height: 100vh;
  font-family: 'Inter', -apple-system, sans-serif;
  color: var(--dark);
  padding-bottom: 2rem;
}

.container {
  max-width: 900px;
}

/* Glassmorphism Card */
.card {
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
  border-radius: 1.5rem;
  box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.1);
  overflow: hidden;
  transition: var(--transition);
}

.card-body {
  padding: 2.5rem;
}

/* Progress Bar */
.progress-container {
  margin-bottom: 2.5rem;
  padding: 0 1rem;
}

.progress-steps {
  display: flex;
  justify-content: space-between;
  position: relative;
  counter-reset: step;
}

.progress-steps::before {
  content: "";
  position: absolute;
  top: 20px;
  left: 0;
  right: 0;
  height: 2px;
  background: #dfe6e9;
  transform: translateY(-50%);
  z-index: 0;
}

.progress-bar-fill {
  position: absolute;
  top: 20px;
  left: 0;
  height: 2px;
  background: var(--primary);
  transform: translateY(-50%);
  z-index: 0;
  transition: var(--transition);
  width: 0%;
}

.step-item {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.step-counter {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid #dfe6e9;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  color: var(--secondary);
  transition: var(--transition);
  margin-bottom: 0.5rem;
}

.step-item.active .step-counter {
  border-color: var(--primary);
  color: var(--primary);
  box-shadow: 0 0 0 4px rgba(44, 62, 80, 0.1);
}

.step-item.completed .step-counter {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

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

.step-item.active .step-label {
  color: var(--primary);
}

/* Form Controls */
.form-group label {
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 0.6rem;
  font-size: 0.95rem;
}

.form-control {
  border-radius: 0.8rem;
  border: 2px solid #edf2f7;
  padding: 0.75rem 1rem;
  height: auto;
  transition: var(--transition);
  background: rgba(255, 255, 255, 0.5);
}

.form-control:focus {
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(44, 62, 80, 0.05);
}

/* Buttons */
.btn {
  border-radius: 0.8rem;
  padding: 0.7rem 1.5rem;
  font-weight: 600;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

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

.btn-primary:hover {
  background: #1a252f;
  border-color: #1a252f;
  transform: translateY(-1px);
}

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

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

/* Responsive adjustments */
@media (max-width: 600px) {
  .card-body {
    padding: 1.5rem;
  }

  .step-label {
    display: none;
  }

  .btn {
    width: 100%;
    margin-bottom: 0.5rem;
  }

  .d-flex.justify-content-between {
    flex-direction: column-reverse;
  }
}

/* Utilities */
.gap-2 {
  gap: 0.5rem;
}

#qr-video {
  border-radius: 1rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Micro-animations */
.fade-in {
  animation: fadeIn 0.4s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Modal Fixes */
.modal {
  z-index: 2000 !important;
}

.modal-backdrop {
  z-index: 1040 !important;
}

.modal-backdrop.show {
  opacity: 0.5 !important;
}

/* Scanner UI Enhancements */
.scanner-overlay-container {
  position: relative;
  overflow: hidden;
  border-radius: 1rem;
  background: #000;
  width: 100%;
  aspect-ratio: 4 / 3;
  /* Forzar proporción estándar */
  display: flex;
  align-items: center;
  justify-content: center;
}

#reader-qr,
#reader-ine,
#reader-doc {
  width: 100% !important;
  height: 100% !important;
}

#reader-qr video,
#reader-ine video,
#reader-doc video {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
}

/* Shaded area with hole - HIDDEN as per user request for full frame capture */
.scanner-shroud {
  display: none !important;
}

.scanner-hole {
  display: none !important;
}

/* Original definitions kept commented out for reference or reversibility */
/*
.scanner-shroud {
  position: absolute; ...
}
*/

/* Orientations - Ajustadas para no ser más grandes que el video */
.scanner-hole-qr {
  width: 200px;
  height: 200px;
}

.scanner-hole-ine {
  width: 200px;
  height: 280px;
}

.scanner-hole-doc {
  width: 200px;
  height: 280px;
}

.scanner-hole::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 10%;
  right: 10%;
  height: 2px;
  background: rgba(255, 0, 0, 0.5);
  box-shadow: 0 0 8px rgba(255, 0, 0, 0.8);
  animation: scan-line 2s infinite ease-in-out;
}

@keyframes scan-line {

  0%,
  100% {
    transform: translateY(-40%);
  }

  50% {
    transform: translateY(40%);
  }
}

/* Specialized scan lines */
.scanner-hole-qr::after {
  animation-name: scan-line-qr;
}

.scanner-hole-ine::after {
  animation-name: scan-line-ine;
}

.scanner-hole-doc::after {
  animation-name: scan-line-doc;
}

@keyframes scan-line-qr {

  0%,
  100% {
    transform: translateY(-110px);
  }

  50% {
    transform: translateY(110px);
  }
}

@keyframes scan-line-ine {

  0%,
  100% {
    transform: translateY(-155px);
  }

  50% {
    transform: translateY(155px);
  }
}

@keyframes scan-line-doc {

  0%,
  100% {
    transform: translateY(-155px);
  }

  50% {
    transform: translateY(155px);
  }
}

.zoom-ctrl {
  display: none !important;
}

#reader-qr video,
#reader-ine video,
#reader-doc video {
  border-radius: 1rem;
  object-fit: cover !important;
  transition: transform 0.3s ease;
}