:root {
  /* Colores corporativos */
  --primary-color: #2563eb;
  --primary-dark: #1e40af;
  --primary-light: #93c5fd;
  --secondary-color: #10b981;
  --accent-color: #3b82f6;
  --text-color: #1f2937;
  --text-light: #6b7280;
  --light-gray: #f3f4f6;
  --medium-gray: #e5e7eb;
  --dark-gray: #4b5563;
  --white: #ffffff;
  --success-color: #10b981;
  --error-color: #ef4444;
  --warning-color: #f59e0b;
}

/* Reset y Tipografía */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', sans-serif;
  color: var(--text-color);
  line-height: 1.6;
  background-color: var(--light-gray);
}

/* Estructura Principal */
.main-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.content-wrapper {
  flex: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
  width: 100%;
}

/* Header Corporativo */
.corporate-header {
  background-color: var(--white);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  padding: 1rem 0;
  border-bottom: 1px solid var(--medium-gray);
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

.logo {
  height: 50px;
}

.header-nav {
  display: flex;
  gap: 1.5rem;
}

.header-nav a {
  color: var(--text-color);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9rem;
  transition: color 0.2s;
}

.header-nav a:hover {
  color: var(--primary-color);
}

/* Panel de Validación */
.validation-panel {
  background-color: var(--white);
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
  padding: 2.5rem;
  margin-bottom: 2rem;
}

.panel-header {
  text-align: center;
  margin-bottom: 2rem;
}

.panel-header h1 {
  font-size: 1.8rem;
  color: var(--text-color);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.panel-header p {
  color: var(--text-light);
  font-size: 1rem;
}

/* Formulario */
.validation-form {
  margin-top: 1.5rem;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--text-color);
  font-size: 0.95rem;
}

.input-with-icon {
  position: relative;
}

.input-with-icon i {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-light);
  font-size: 1rem;
}

.input-with-icon input {
  width: 100%;
  padding: 0.8rem 1rem 0.8rem 2.5rem;
  font-size: 1rem;
  border: 1px solid var(--medium-gray);
  border-radius: 8px;
  transition: all 0.2s;
  background-color: var(--light-gray);
}

.input-with-icon input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
  background-color: var(--white);
}

.form-actions {
  display: flex;
  gap: 1rem;
  margin-top: 2rem;
}

.btn-primary, .btn-secondary, .btn-download {
  padding: 0.8rem 1.5rem;
  border-radius: 8px;
  font-weight: 500;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  text-decoration: none;
}

.btn-primary {
  background-color: var(--primary-color);
  color: var(--white);
  border: none;
  flex: 1;
}

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

.btn-secondary {
  background-color: var(--white);
  color: var(--text-color);
  border: 1px solid var(--medium-gray);
  flex: 1;
}

.btn-secondary:hover {
  background-color: var(--light-gray);
}

.validation-info {
  margin-top: 2rem;
}

.info-box {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  background-color: #f0f7ff;
  border-radius: 8px;
  border-left: 4px solid var(--primary-color);
}

.info-box i {
  color: var(--primary-color);
  font-size: 1.25rem;
}

.info-box p {
  font-size: 0.9rem;
  color: var(--text-light);
}

.info-box a {
  color: var(--primary-color);
  font-weight: 500;
  text-decoration: none;
}

.info-box a:hover {
  text-decoration: underline;
}

/* Resultados de Validación */
#result-section {
  background-color: var(--white);
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
  padding: 2.5rem;
  margin-top: 2rem;
}

.result-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--medium-gray);
}

.result-header h2 {
  font-size: 1.5rem;
  color: var(--text-color);
}

.status-badge {
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-weight: 600;
  font-size: 0.9rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.status-badge.valid {
  background-color: rgba(16, 185, 129, 0.1);
  color: var(--success-color);
}

.status-badge.invalid {
  background-color: rgba(239, 68, 68, 0.1);
  color: var(--error-color);
}

/* Detalles del Certificado */
.detail-section {
  margin-bottom: 2rem;
}

.detail-section h3 {
  font-size: 1.2rem;
  margin-bottom: 1.5rem;
  color: var(--text-color);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

.detail-item {
  margin-bottom: 1rem;
}

.detail-label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-light);
  margin-bottom: 0.25rem;
  font-weight: 500;
}

.detail-value {
  font-size: 1rem;
  color: var(--text-color);
  line-height: 1.5;
}

/* Sección de Acciones */
.action-section {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--medium-gray);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.btn-download {
  background-color: var(--success-color);
  color: var(--white);
  padding: 1rem 2rem;
  border-radius: 8px;
  font-weight: 500;
  width: 100%;
  max-width: 400px;
  text-align: center;
}

.btn-download:hover {
  background-color: #0d9b6c;
}

.validation-info {
  text-align: center;
  margin-top: 1rem;
  font-size: 0.9rem;
  color: var(--text-light);
}

/* Footer Corporativo */
.corporate-footer {
  background-color: #1f2937;
  color: var(--white);
  padding: 3rem 0 1.5rem;
  margin-top: 3rem;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.footer-logo {
  height: 50px;
  width: 100px;
}

.footer-brand p {
  color: #9ca3af;
  font-size: 0.9rem;
}

.footer-links {
  display: flex;
  gap: 3rem;
}

.link-group {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.link-group h4 {
  font-size: 1rem;
  margin-bottom: 0.5rem;
  color: var(--white);
}

.link-group a {
  color: #d1d5db;
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.2s;
}

.link-group a:hover {
  color: var(--white);
}

.footer-bottom {
  max-width: 1200px;
  margin: 2rem auto 0;
  padding: 1.5rem 2rem 0;
  border-top: 1px solid #374151;
  display: flex;
  justify-content: space-between;
  color: #9ca3af;
  font-size: 0.85rem;
}

/* Responsive */
@media (max-width: 768px) {
  .content-wrapper {
    padding: 1.5rem;
  }
  
  .validation-panel, #result-section {
    padding: 1.5rem;
  }
  
  .header-content {
    flex-direction: column;
    gap: 1rem;
  }
  
  .form-actions {
    flex-direction: column;
  }
  
  .footer-content {
    grid-template-columns: 1fr;
  }
  
  .footer-links {
    flex-direction: column;
    gap: 1.5rem;
  }
  
  .footer-bottom {
    flex-direction: column;
    gap: 0.5rem;
    text-align: center;
  }
}

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

#result-section {
  animation: fadeIn 0.3s ease-out forwards;
}

.hidden {
  display: none;
}

.syllabus-list {
  list-style-type: none;
  padding-left: 0;
  margin: 0.5rem 0;
}

.syllabus-list li {
  margin-bottom: 0.6rem;
  display: flex;
  align-items: flex-start;
  line-height: 1.5;
}

.syllabus-icon {
  color: var(--success-color); /* Color verde del check */
  margin-right: 0.75rem;
  font-size: 0.9em;
  margin-top: 0.1rem;
  flex-shrink: 0;
}

/* Estilos para el temario - Versión mejorada */
.syllabus-accordion {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 1rem;
}

.module-item {
  background-color: var(--light-gray);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  transition: all 0.3s ease;
}

.module-item.active {
  background-color: var(--white);
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.module-header {
  padding: 1rem;
  display: flex;
  align-items: center;
  cursor: pointer;
  gap: 0.75rem;
  transition: background-color 0.2s;
}

.module-header:hover {
  background-color: rgba(0,0,0,0.03);
}

.module-icon {
  color: var(--primary-color);
  font-size: 1.1rem;
  width: 1.5rem;
  text-align: center;
}

.module-title {
  font-size: 1rem;
  margin: 0;
  flex-grow: 1;
  color: var(--text-color);
}

.module-toggle {
  color: var(--text-light);
  transition: transform 0.3s ease;
}

.module-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  padding: 0 1rem;
}

.module-item.active .module-content {
  max-height: 500px; /* Ajusta según necesidad */
  padding: 0 1rem 1rem;
}

.topics-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.topic-item {
  font-size: 0.9rem;
  padding: 0.5rem 0.5rem 0.5rem 2rem;
  position: relative;
  line-height: 1.4;
}

.topic-icon {
  position: absolute;
  left: 0.5rem;
  top: 0.7rem;
  font-size: 0.7rem;
  color: var(--success-color);
}

/* Estilos para cursos sin módulos (SIGA) */
.syllabus-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 0.75rem;
}

.syllabus-item {
  font-size: 0.9rem;
  padding: 0.5rem 0.5rem 0.5rem 2rem;
  position: relative;
  line-height: 1.4;
  background-color: var(--light-gray);
  border-radius: 4px;
}

.syllabus-icon {
  position: absolute;
  left: 0.5rem;
  top: 0.7rem;
  font-size: 0.7rem;
  color: var(--success-color);
}

/* Diseño responsivo */
@media (max-width: 768px) {
  .syllabus-list {
    grid-template-columns: 1fr;
  }
  
  .module-header {
    padding: 0.75rem;
  }
  
  .topic-item, .syllabus-item {
    padding: 0.5rem 0.5rem 0.5rem 1.75rem;
  }
}

/* Estilos para validación QR */
.input-with-icon input.error {
  border-color: var(--error-color) !important;
  background-color: rgba(239, 68, 68, 0.05);
}

/* Indicador de validación automática */
.qr-validation-indicator {
  position: fixed;
  top: 20px;
  right: 20px;
  background: var(--primary-color);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 0.8rem;
  z-index: 1000;
  animation: slideIn 0.5s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

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

/* Loader específico para QR */
.qr-loading .spinner-text {
  font-weight: 600;
  color: var(--primary-color);
}

/* Mejoras visuales para móviles (importante para QR) */
@media (max-width: 768px) {
  .validation-panel {
    margin-top: 1rem;
  }
  
  .qr-validation-indicator {
    top: 10px;
    right: 10px;
    left: 10px;
    text-align: center;
  }
}
