/* ========================================
   Variables y Colores Personalizados
   ======================================== */
:root {
  --primary-dark: #0d47a1;
  --primary-medium: #1976d2;
  --primary-light: #e3f2fd;
  --text-muted: #6c757d;
}

/* ========================================
   Estilos Generales
   ======================================== */
body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

main {
  flex: 1;
}

/* ========================================
   Colores de Bootstrap Personalizados
   ======================================== */
.bg-primary-custom {
  background-color: #053d99;
}

.bg-light-blue {
  background-color: var(--primary-light);
}

.text-primary-custom {
  color: var(--primary-dark) !important;
}

.btn-secondary-custom {
  background-color: var(--primary-medium);
  border-color: var(--primary-medium);
  color: white;
}

.btn-secondary-custom:hover,
.btn-secondary-custom:focus {
  background-color: var(--primary-dark);
  border-color: var(--primary-dark);
  color: white;
}

/* ========================================
   Header y Navegación
   ======================================== */
.navbar-dark .navbar-nav .nav-link {
  color: rgba(255, 255, 255, 0.9);
  transition: color 0.3s ease;
}

.navbar-dark .navbar-nav .nav-link:hover,
.navbar-dark .navbar-nav .nav-link:focus {
  color: rgba(255, 255, 255, 1);
}

.navbar-dark .navbar-nav .nav-link.active {
  color: white;
  font-weight: 500;
}

/* ========================================
   Sección de Búsqueda
   ======================================== */
#searchInput {
  border: 2px solid #dee2e6;
  transition: border-color 0.3s ease;
}

#searchInput:focus {
  border-color: var(--primary-medium);
  box-shadow: 0 0 0 0.2rem rgba(25, 118, 210, 0.25);
}

#searchResults .border-bottom:last-child {
  border-bottom: none !important;
}

#searchResults a {
  color: var(--primary-medium);
  transition: color 0.3s ease;
}

#searchResults a:hover {
  color: var(--primary-dark);
  text-decoration: underline !important;
}

/* ========================================
   Categorías
   ======================================== */
.category-img {
  height: 200px;
  object-fit: cover;
}

.card {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;
}

/* ========================================
   Enlaces Útiles
   ======================================== */
.link-card {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.link-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;
}

.link-img {
  object-fit: cover;
  height: 100%;
}

.icon-custom {
  color: var(--primary-medium);
  font-size: 1.5rem;
}

/* ========================================
   Footer
   ======================================== */
footer a {
  transition: opacity 0.3s ease;
}

footer a:hover,
footer a:focus {
  opacity: 0.8;
}

.social-icon {
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.social-icon:hover,
.social-icon:focus {
  transform: scale(1.1);
  opacity: 0.9;
}

.footer-divider {
  border-color: rgba(255, 255, 255, 0.2);
}

/* ========================================
   Modales
   ======================================== */
.modal-header-custom {
  border-bottom: 3px solid var(--primary-medium);
}

.modal-img {
  width: 100%;
  max-height: 400px;
  object-fit: cover;
}

.alert-custom {
  background-color: var(--primary-light);
  border: 1px solid var(--primary-medium);
  color: var(--primary-dark);
}

/* ========================================
   Utilidades de Accesibilidad
   ======================================== */
.btn:focus,
.form-control:focus,
a:focus {
  outline: 2px solid var(--primary-medium);
  outline-offset: 2px;
}

/* Skip to main content link (para accesibilidad) */
.skip-to-main {
  position: absolute;
  left: -9999px;
  z-index: 999;
}

.skip-to-main:focus {
  left: 50%;
  transform: translateX(-50%);
  top: 10px;
  padding: 10px 20px;
  background-color: var(--primary-dark);
  color: white;
  text-decoration: none;
  border-radius: 4px;
}

/* ========================================
   Responsive Design
   ======================================== */
@media (max-width: 768px) {
  .category-img {
    height: 150px;
  }
  
  .icon-custom {
    font-size: 1.2rem;
  }
  
  footer .col-12 {
    text-align: center;
  }
  
  footer .d-flex {
    justify-content: center;
  }
}

@media (max-width: 576px) {
  h1.h4 {
    font-size: 1rem !important;
  }
  
  .input-group-lg .form-control {
    font-size: 1rem;
  }
}

/* ========================================
   Animaciones
   ======================================== */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.card {
  animation: fadeIn 0.5s ease-in-out;
}

/* ========================================
   Estados de Enlaces
   ======================================== */
a {
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* ========================================
   Mejoras de Bootstrap
   ======================================== */
.btn {
  transition: all 0.3s ease;
}

.form-control {
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

/* ========================================
   Print Styles
   ======================================== */
@media print {
  .navbar,
  footer,
  .btn,
  .modal {
    display: none !important;
  }
  
  .card {
    break-inside: avoid;
    page-break-inside: avoid;
  }
}


 .hover-shadow {
    transition: all 0.3s ease;
  }
  
  .hover-shadow:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1) !important;
  }
  
  .transition-all {
    transition: all 0.3s ease;
  }
  
  .stretched-link::after {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 1;
    content: "";
  }
  
  .tramite-item .card {
    border: 1px solid #e9ecef;
  }
  
  .tramite-item .card:hover {
    border-color: #007bff;
  }
  
  #contador-resultados {
    font-size: 0.875rem;
  }
  
  #badge-contador {
    font-size: 0.8rem;
  }
  
  #sin-resultados {
    border-radius: 8px;
  }


.form-control,
.form-select,
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="url"],
input[type="file"],
select,
textarea {
  background-color: #ffffff !important;
  color: #000000 !important;
  border: 2px solid #6c757d !important;
  font-size: 1rem;
  line-height: 1.5;
}

.form-control::placeholder,
.form-select::placeholder,
input::placeholder,
textarea::placeholder {
  color: #4a4a4a !important;
  opacity: 1;
}

.form-control:focus,
.form-select:focus,
input:focus,
select:focus,
textarea:focus {
  background-color: #ffffff !important;
  color: #000000 !important;
  border-color: #0056b3 !important;
  box-shadow: 0 0 0 0.25rem rgba(0, 86, 179, 0.25) !important;
  outline: none;
}

.form-control:disabled,
.form-select:disabled,
input:disabled,
select:disabled,
textarea:disabled {
  background-color: #e9ecef !important;
  color: #1a1a1a !important;
  border-color: #adb5bd !important;
}

.form-control[readonly],
input[readonly],
textarea[readonly] {
  background-color: #f8f9fa !important;
  color: #000000 !important;
  border-color: #6c757d !important;
}

input[type="file"] {
  padding: 0.5rem;
  background-color: #ffffff !important;
  color: #000000 !important;
  border: 2px solid #6c757d !important;
}

.form-select {
  background-color: #ffffff !important;
  color: #000000 !important;
  border: 2px solid #6c757d !important;
}

.form-select option {
  background-color: #ffffff !important;
  color: #000000 !important;
}

.form-control.is-invalid,
.form-select.is-invalid,
input.is-invalid,
select.is-invalid,
textarea.is-invalid {
  border-color: #b02a37 !important;
  background-color: #ffffff !important;
  color: #000000 !important;
}

.form-control.is-valid,
.form-select.is-valid {
  border-color: #1e7e34 !important;
  background-color: #ffffff !important;
  color: #000000 !important;
}

/* ===== FIN MEJORAS CAJAS DE TEXTO ===== */

/* Estilos para formulario paso a paso */
.step-indicator {
  margin-bottom: 30px;
  position: relative;
}

[role="tablist"] {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  counter-reset: step;
  padding: 0;
  margin: 0;
}

.step-item {
  flex: 1;
  text-align: center;
  position: relative;
  min-width: 120px;
  cursor: pointer;
  padding: 10px 5px;
  border-radius: 5px;
  transition: all 0.3s ease;
  background-color: #f8f9fa;
}

.step-item:hover {
  background-color: rgba(0, 86, 179, 0.1);
}

.step-item:focus {
  outline: 2px solid #0056b3;
  outline-offset: 2px;
}

.step-item::before {
  content: counter(step);
  counter-increment: step;
  display: block;
  width: 40px;
  height: 40px;
  background-color: #e9ecef;
  border: 2px solid #adb5bd;
  border-radius: 50%;
  margin: 0 auto 10px;
  line-height: 36px;
  font-weight: bold;
  color: #495057;
  transition: all 0.3s ease;
}

.step-item.active::before {
  background-color: #0056b3;
  border-color: #004494;
  color: #ffffff;
}

.step-item.completed::before {
  background-color: #1e7e34;
  border-color: #145523;
  color: #ffffff;
  content: "✓";
}

.step-item.completed.active::before {
  background-color: #1e7e34;
  border-color: #145523;
}

.step-label {
  display: block;
  font-weight: 500;
  color: #000000;
  font-size: 0.9rem;
  background-color: transparent;
}

.step-item.active .step-label {
  color: #0056b3;
  font-weight: 600;
}

.step-item.completed .step-label {
  color: #1e7e34;
}

.step-content {
  display: none;
  animation: fadeIn 0.5s ease-in-out;
}

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

.step-content:focus {
  outline: 2px solid #0056b3;
  outline-offset: 4px;
}

.step-actions {
  display: flex;
  justify-content: space-between;
  margin-top: 30px;
  gap: 15px;
}

.step-actions .btn {
  min-width: 120px;
}

@media (max-width: 768px) {
  [role="tablist"] {
    flex-direction: column;
    align-items: stretch;
  }
  
  .step-item {
    display: flex;
    align-items: center;
    text-align: left;
    gap: 15px;
  }
  
  .step-item::before {
    margin: 0;
    flex-shrink: 0;
  }
  
  .step-actions {
    flex-direction: column;
  }
  
  .step-actions .btn {
    width: 100%;
  }
}

.h5, 
.h6,
h2.h5,
h3.h6,
.section-header h3,
.card-header h2,
[class*="h5"],
[class*="h6"] {
  color: #000 !important;
}

.card-header.bg-dark {
  background-color: #2c3e50 !important;
}

.card-header.bg-dark h2,
.card-header.bg-dark .h5 {
  color: #ffffff !important;
}

.text-secondary {
  color: #2a2a2a !important;
  font-weight: 500;
}

.form-text {
  font-size: 0.875em;
  color: #2a2a2a;
}

.alert-secondary {
  background-color: #e9ecef;
  border-color: #ced4da;
  color: #000000;
}

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

.alert-success strong {
  color: #0a3b1e;
}

.requisito-item {
  margin-bottom: 20px;
  border-left: 3px solid #0056b3;
  padding-left: 15px;
  color: #000000;
}

.requisito-item strong {
  color: #000000;
}

.requisito-subitem {
  margin-left: 20px;
  margin-top: 10px;
  font-size: 0.95em;
  color: #1a1a1a;
}

.mt-3.small.text-secondary {
  color: #1a1a1a !important;
  font-weight: 500;
}

.btn-primary {
  background-color: #0056b3;
  border-color: #004494;
  color: #ffffff;
}

.btn-primary:hover, 
.btn-primary:focus {
  background-color: #004494;
  border-color: #003d80;
  color: #ffffff;
}

.btn-secondary {
  background-color: #6c757d;
  border-color: #5a6268;
  color: #ffffff;
}

.btn-secondary:hover,
.btn-secondary:focus {
  background-color: #5a6268;
  border-color: #4e555b;
  color: #ffffff;
}

.btn-success {
  background-color: #1e7e34;
  border-color: #145523;
  color: #ffffff;
}

.btn-success:hover,
.btn-success:focus {
  background-color: #145523;
  border-color: #0c3d1a;
  color: #ffffff;
}

.form-label {
  color: #000000;
  font-weight: 500;
}

.required-field label::after {
  content: " *";
  color: #b02a37;
  font-weight: bold;
}

.error-message,
.invalid-feedback {
  color: #b02a37;
  font-size: 0.875em;
  margin-top: 0.25rem;
}

.section-header {
  background-color: #2c3e50 !important;
  padding: 12px 15px;
  border-bottom: 1px solid #1a2632;
  font-weight: 600;
}

.section-header h3,
.section-header .h6 {
  color: #ffffff !important;
  margin-bottom: 0;
}

#page-title {
  color: #000000 !important;
  font-weight: 600;
}

.card-body.bg-light {
  background-color: #f8f9fa !important;
}

.checkbox-item label,
.radio-item label {
  margin-bottom: 0;
  font-weight: normal;
  color: #000000;
}

.requisitos-container {
  max-height: none;
  overflow-y: visible;
  padding-right: 10px;
}

.requisitos-container:focus {
  outline: 2px solid #0056b3;
  outline-offset: 2px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

:focus {
  outline: 2px solid #0056b3;
  outline-offset: 2px;
}

[aria-invalid="true"] {
  border-color: #b02a37;
}

[aria-invalid="true"]:focus {
  box-shadow: 0 0 0 0.2rem rgba(176, 42, 55, 0.25);
}

.section-card {
  margin-bottom: 20px;
  border: 1px solid #adb5bd;
  border-radius: 5px;
  overflow: hidden;
  background-color: #ffffff;
}

.section-body {
  padding: 20px;
  background-color: #ffffff;
}

.checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  margin-top: 10px;
}

.checkbox-item {
  display: flex;
  align-items: center;
  margin-right: 20px;
}

.checkbox-item input[type="checkbox"],
.radio-item input[type="radio"] {
  margin-right: 5px;
  width: 18px;
  height: 18px;
}

.radio-group {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-top: 10px;
}

.radio-item {
  display: flex;
  align-items: center;
}

.conditional-field {
  transition: all 0.3s ease;
}

.conditional-field.hide {
  display: none;
}

.alert-container {
  width: 100%;
  margin-bottom: 20px;
}

.alert-container .alert {
  margin-bottom: 10px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.alert-container .alert:last-child {
  margin-bottom: 0;
}

.alert {
  animation: fadeIn 0.3s ease-in-out;
}

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

.pdf-processing {
  font-size: 0.875rem;
  color: #0056b3;
  margin-top: 0.25rem;
  padding: 0.25rem 0;
}

.pdf-success {
  font-size: 0.875rem;
  color: #1e7e34;
  margin-top: 0.25rem;
  padding: 0.25rem 0;
}

.pdf-error {
  font-size: 0.875rem;
  color: #b02a37;
  margin-top: 0.25rem;
  padding: 0.25rem 0;
}