:root {
  /* ===== DARK MODE VARIABLES ===== */
  --bg-dark: #0f1419;
  --bg-dark-secondary: #161b22;
  --bg-dark-card: #1c2128;
  --bg-dark-header: #0d1117;

  --text-dark-primary: #e6edf3;
  --text-dark-secondary: #8b949e;
  --text-dark-muted: #6e7681;

  --verde-principal-dark: #548b3b;
  --verde-hover-dark: #3a8a42;
  --verde-claro-dark: #8fc96f;
  --amarillo-dorado-dark: #e8b725;
  --azul-proceso-dark: #2c5aa0;
  --gris-sostenido-dark: #161b22;

  --nivel-1-dark: #2a4d1f;
  --nivel-2-dark: #3d6b2d;
  --nivel-3-dark: #4a8a35;
  --nivel-4-dark: #57a93d;
  --nivel-5-dark: #65b845;

  --shadow-dark: 0 8px 24px rgba(0, 0, 0, 0.3);
  --border-dark: 1px solid rgba(139, 148, 158, 0.15);
}

[data-theme="dark"] {
  background-color: var(--bg-dark);
  color: var(--text-dark-primary);
}

[data-theme="dark"] body {
  background-color: var(--bg-dark);
  color: var(--text-dark-primary);
}

[data-theme="dark"] * {
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* ===== HEADER ===== */

[data-theme="dark"] .header-top {
  background: var(--bg-dark-header);
  border-bottom: var(--border-dark);
  color: var(--text-dark-secondary);
}

[data-theme="dark"] .header-main {
  background: var(--bg-dark-header);
  border-bottom: var(--border-dark);
}

[data-theme="dark"] .header-main .container {
  background: var(--bg-dark-header);
}

[data-theme="dark"] .header-main .logo img {
  filter: brightness(1.2);
}

[data-theme="dark"] .header-main .logo-text h1 {
  color: var(--verde-principal-dark);
}

[data-theme="dark"] .header-main .logo-text p {
  color: var(--text-dark-secondary);
}

[data-theme="dark"] .nav {
  background: var(--bg-dark-header);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .nav a {
  color: var(--text-dark-primary);
  border-bottom: 2px solid transparent;
}

[data-theme="dark"] .nav a:hover,
[data-theme="dark"] .nav a.active {
  color: var(--verde-principal-dark);
  border-bottom-color: var(--verde-principal-dark);
}

/* ===== DARK MODE TOGGLE BUTTON ===== */

.dark-mode-toggle {
  position: fixed;
  top: 90px;
  right: 20px;
  z-index: 1000;
  background: linear-gradient(135deg, var(--verde-principal-dark), var(--verde-hover-dark));
  color: white;
  border: none;
  border-radius: 50px;
  padding: 12px 16px;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(84, 139, 59, 0.3);
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
}

.dark-mode-toggle:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 6px 20px rgba(84, 139, 59, 0.4);
}

.dark-mode-toggle:active {
  transform: translateY(0) scale(1);
}

.dark-mode-toggle .icon-sun {
  display: none;
}

.dark-mode-toggle .icon-moon {
  display: block;
}

[data-theme="dark"] .dark-mode-toggle .icon-sun {
  display: block;
}

[data-theme="dark"] .dark-mode-toggle .icon-moon {
  display: none;
}

/* ===== HERO SECTION ===== */

[data-theme="dark"] .hero {
  background: linear-gradient(135deg, var(--bg-dark) 0%, var(--bg-dark-secondary) 100%);
  position: relative;
  overflow: hidden;
}

[data-theme="dark"] .hero-overlay {
  background: linear-gradient(180deg, rgba(15, 20, 25, 0.95) 0%, rgba(15, 20, 25, 0.85) 100%);
}

[data-theme="dark"] .hero-content h1 {
  color: var(--verde-principal-dark);
  text-shadow: 0 0 30px rgba(84, 139, 59, 0.3);
}

[data-theme="dark"] .hero-content p {
  color: var(--text-dark-secondary);
}

[data-theme="dark"] .hero-buttons .btn-primary {
  background: linear-gradient(135deg, var(--verde-principal-dark), var(--verde-hover-dark));
  box-shadow: 0 6px 20px rgba(84, 139, 59, 0.4);
}

[data-theme="dark"] .hero-buttons .btn-primary:hover {
  box-shadow: 0 8px 25px rgba(84, 139, 59, 0.5);
  transform: translateY(-3px);
}

[data-theme="dark"] .hero-buttons .btn-secondary {
  border-color: var(--verde-principal-dark);
  color: var(--verde-principal-dark);
  background: transparent;
}

[data-theme="dark"] .hero-buttons .btn-secondary:hover {
  background: rgba(84, 139, 59, 0.1);
}

[data-theme="dark"] .hero-stat-num {
  color: var(--verde-principal-dark);
}

/* ===== QUIÉNES SOMOS ===== */

[data-theme="dark"] .quienes-somos {
  background: linear-gradient(180deg, var(--bg-dark) 0%, var(--bg-dark-secondary) 100%);
  padding: 90px 0;
}

[data-theme="dark"] .quienes-somos-text h3 {
  color: var(--verde-principal-dark);
}

[data-theme="dark"] .quienes-somos-text p {
  color: var(--text-dark-secondary);
}

[data-theme="dark"] .valor-item {
  background: var(--bg-dark-card);
  border-color: var(--nivel-4-dark);
  color: var(--text-dark-primary);
}

[data-theme="dark"] .valor-item h4 {
  color: var(--text-dark-primary);
}

[data-theme="dark"] .datos-institucionales {
  background: linear-gradient(
    160deg,
    var(--nivel-1-dark),
    var(--nivel-2-dark)
  );
  box-shadow: 0 16px 34px rgba(42, 77, 31, 0.4);
}

[data-theme="dark"] .datos-table td {
  border-bottom-color: rgba(255, 255, 255, 0.15);
}

[data-theme="dark"] .datos-table td:first-child {
  color: #eaf6e3;
}

[data-theme="dark"] .datos-table td:last-child {
  color: var(--text-dark-primary);
}

[data-theme="dark"] .section-title h2 {
  color: var(--verde-principal-dark);
}

[data-theme="dark"] .section-title p {
  color: var(--text-dark-secondary);
}

/* ===== SERVICIOS ===== */

[data-theme="dark"] .servicios {
  background: linear-gradient(180deg, var(--bg-dark) 0%, var(--bg-dark-secondary) 100%);
  padding: 90px 0;
}

[data-theme="dark"] .section-title h2 {
  color: var(--verde-principal-dark);
}

[data-theme="dark"] .section-title p {
  color: var(--text-dark-secondary);
}

[data-theme="dark"] .filter-btn {
  background: var(--bg-dark-card);
  color: var(--verde-principal-dark);
  border-color: var(--verde-principal-dark);
}

[data-theme="dark"] .filter-btn:hover,
[data-theme="dark"] .filter-btn.active {
  background: var(--verde-principal-dark);
  color: white;
  box-shadow: 0 10px 18px rgba(84, 139, 59, 0.3);
}

[data-theme="dark"] .servicio-bloque {
  background: var(--bg-dark-card);
  box-shadow: var(--shadow-dark);
}

[data-theme="dark"] .servicio-texto h3 {
  color: var(--verde-principal-dark);
}

[data-theme="dark"] .servicio-texto p {
  color: var(--text-dark-primary);
}

[data-theme="dark"] .servicio-texto li {
  color: var(--text-dark-secondary);
}

[data-theme="dark"] .servicio-cta .btn {
  background: linear-gradient(135deg, var(--verde-principal-dark), var(--verde-hover-dark));
  color: white;
  box-shadow: 0 4px 15px rgba(84, 139, 59, 0.3);
}

[data-theme="dark"] .servicio-cta .btn:hover {
  box-shadow: 0 6px 20px rgba(84, 139, 59, 0.4);
  transform: translateY(-2px);
}

[data-theme="dark"] .badge-tasa {
  background: var(--amarillo-dorado-dark);
  color: #000;
}

/* ===== CRÉDITOS ===== */

[data-theme="dark"] .section.creditos {
  background: linear-gradient(180deg, var(--bg-dark) 0%, var(--bg-dark-secondary) 100%);
  padding: 90px 0;
}

[data-theme="dark"] .section-title h2 {
  color: var(--verde-principal-dark);
}

[data-theme="dark"] .section-title p {
  color: var(--text-dark-secondary);
}

[data-theme="dark"] .filter-btn {
  background: var(--bg-dark-card);
  color: var(--verde-principal-dark);
  border-color: var(--verde-principal-dark);
}

[data-theme="dark"] .filter-btn:hover,
[data-theme="dark"] .filter-btn.active {
  background: var(--verde-principal-dark);
  color: white;
}

[data-theme="dark"] .results-counter {
  color: var(--text-dark-secondary);
}

[data-theme="dark"] .results-counter strong {
  color: var(--verde-principal-dark);
}

[data-theme="dark"] .credito-card {
  background: var(--bg-dark-card);
  border: 1px solid rgba(84, 139, 59, 0.2);
  box-shadow: var(--shadow-dark);
  transition: all 0.3s ease;
}

[data-theme="dark"] .credito-card:hover {
  border-color: var(--verde-principal-dark);
  transform: translateY(-5px);
  box-shadow: 0 12px 30px rgba(84, 139, 59, 0.3);
}

[data-theme="dark"] .credito-card-image-container {
  background: linear-gradient(135deg, var(--nivel-1-dark), var(--nivel-2-dark));
  border-bottom: 1px solid rgba(84, 139, 59, 0.2);
}

[data-theme="dark"] .credito-badge {
  background: var(--verde-principal-dark);
  color: white;
  border: 2px solid var(--verde-claro-dark);
}

[data-theme="dark"] .credito-content h3 {
  color: var(--verde-principal-dark);
}

[data-theme="dark"] .credito-content h4 {
  color: var(--text-dark-primary);
}

[data-theme="dark"] .credito-content p {
  color: var(--text-dark-secondary);
}

[data-theme="dark"] .info-label {
  color: var(--text-dark-muted);
}

[data-theme="dark"] .info-value {
  color: var(--text-dark-primary);
}

[data-theme="dark"] .tasa-label {
  color: var(--text-dark-secondary);
}

[data-theme="dark"] .tasa-value {
  color: var(--verde-principal-dark);
}

[data-theme="dark"] .categoria-tag {
  background: var(--nivel-1-dark);
  color: var(--verde-claro-dark);
}

[data-theme="dark"] .destinatarios-title {
  color: var(--verde-principal-dark);
}

[data-theme="dark"] .destinatarios-list li {
  color: var(--text-dark-secondary);
}

[data-theme="dark"] .btn-solicitar {
  background: linear-gradient(135deg, var(--verde-principal-dark), var(--verde-hover-dark));
  color: white;
  border: none;
}

[data-theme="dark"] .btn-solicitar:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(84, 139, 59, 0.4);
}

[data-theme="dark"] .tasas-container {
  gap: 12px;
}

[data-theme="dark"] .tasa-badge {
  background: var(--bg-dark);
  border: 1px solid var(--verde-principal-dark);
  color: var(--text-dark-primary);
}

[data-theme="dark"] .tasa-badge.mora {
  border-color: #ef4444;
}

/* ===== CÓMO ASOCIARSE ===== */

[data-theme="dark"] .como-asociarse {
  background: linear-gradient(180deg, var(--bg-dark) 0%, var(--bg-dark-secondary) 100%);
  padding: 60px 0;
}

[data-theme="dark"] .section-title h2 {
  color: var(--verde-principal-dark);
}

[data-theme="dark"] .section-title p {
  color: var(--text-dark-secondary);
}

[data-theme="dark"] .proceso-step {
  background: var(--bg-dark-card);
  border-left-color: var(--nivel-2-dark);
  color: var(--text-dark-primary);
}

[data-theme="dark"] .paso-1 { border-left-color: var(--nivel-1-dark); }
[data-theme="dark"] .paso-2 { border-left-color: var(--nivel-2-dark); }
[data-theme="dark"] .paso-3 { border-left-color: var(--nivel-3-dark); }
[data-theme="dark"] .paso-4 { border-left-color: var(--nivel-4-dark); }
[data-theme="dark"] .paso-5 { border-left-color: var(--nivel-5-dark); }

[data-theme="dark"] .proceso-step h4 {
  color: var(--azul-proceso-dark);
}

[data-theme="dark"] .proceso-step p {
  color: var(--text-dark-secondary);
}

[data-theme="dark"] .requisitos,
[data-theme="dark"] .beneficios {
  background: var(--bg-dark-card);
  border-top-color: var(--verde-claro-dark);
}

[data-theme="dark"] .requisitos h3,
[data-theme="dark"] .beneficios h3 {
  color: var(--verde-principal-dark);
}

[data-theme="dark"] .requisitos li {
  color: var(--text-dark-secondary);
  border-bottom-color: rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .requisitos li::before {
  color: var(--amarillo-dorado-dark);
}

[data-theme="dark"] .beneficio-item span:first-child {
  color: var(--verde-principal-dark);
}

[data-theme="dark"] .btn-primary {
  background: var(--verde-principal-dark);
  color: white;
  box-shadow: 0 8px 18px rgba(84, 139, 59, 0.3);
}

[data-theme="dark"] .btn-primary:hover {
  background: var(--verde-hover-dark);
  box-shadow: 0 12px 24px rgba(84, 139, 59, 0.4);
}

/* ===== EQUIPO ===== */

[data-theme="dark"] .organigrama-container {
  background: linear-gradient(180deg, var(--bg-dark) 0%, var(--bg-dark-secondary) 100%);
}

[data-theme="dark"] .info-item {
  color: var(--text-dark-secondary);
}

[data-theme="dark"] .organigrama-box {
  background: var(--bg-dark-card);
  border: 1px solid var(--verde-principal-dark);
}

[data-theme="dark"] .organigrama-box-title {
  color: var(--verde-principal-dark);
}

[data-theme="dark"] .organigrama-box-level {
  background: var(--amarillo-dorado-dark);
  color: #000;
}

[data-theme="dark"] .organigrama-box-content {
  color: var(--text-dark-primary);
}

/* ===== ESTADOS FINANCIEROS ===== */

[data-theme="dark"] .estados-financieros {
  background: linear-gradient(180deg, var(--bg-dark) 0%, var(--bg-dark-secondary) 100%);
}

[data-theme="dark"] .financieros-filters {
  background: var(--bg-dark-card);
  border: 1px solid var(--verde-principal-dark);
}

[data-theme="dark"] .filter-select {
  background: var(--bg-dark);
  color: var(--text-dark-primary);
  border-color: var(--verde-principal-dark);
}

[data-theme="dark"] .filter-select option {
  background: var(--bg-dark);
  color: var(--text-dark-primary);
}

[data-theme="dark"] .year-section h3 {
  color: var(--verde-principal-dark);
}

[data-theme="dark"] .month-header {
  background: var(--bg-dark-secondary);
  color: var(--text-dark-primary);
  border: 1px solid var(--verde-principal-dark);
}

[data-theme="dark"] .month-header h4 {
  color: var(--verde-principal-dark);
}

[data-theme="dark"] .toggle-icon {
  color: var(--verde-principal-dark);
}

[data-theme="dark"] .financiero-card {
  background: var(--bg-dark-secondary);
  border: 1px solid rgba(84, 139, 59, 0.1);
}

[data-theme="dark"] .pdf-filename {
  color: var(--text-dark-primary);
}

[data-theme="dark"] .financiero-card a {
  color: var(--verde-principal-dark);
}

[data-theme="dark"] .pagination {
  background: var(--bg-dark-card);
  border: 1px solid var(--verde-principal-dark);
}

[data-theme="dark"] .pagination button {
  background: var(--bg-dark);
  color: var(--text-dark-primary);
  border: 1px solid var(--verde-principal-dark);
}

[data-theme="dark"] .pagination button:hover:not(:disabled) {
  background: var(--verde-principal-dark);
  color: white;
}

[data-theme="dark"] .pagination button:disabled {
  opacity: 0.5;
}

[data-theme="dark"] #page-info {
  color: var(--text-dark-secondary);
}

/* ===== CONTACTO ===== */

[data-theme="dark"] .contacto-section {
  background: linear-gradient(180deg, var(--bg-dark) 0%, var(--bg-dark-secondary) 100%);
}

[data-theme="dark"] .contacto-form {
  background: var(--bg-dark-card);
  border: 1px solid var(--verde-principal-dark);
}

[data-theme="dark"] .form-group label {
  color: var(--text-dark-primary);
}

[data-theme="dark"] .form-control {
  background: var(--bg-dark);
  color: var(--text-dark-primary);
  border: 1px solid var(--verde-principal-dark);
}

[data-theme="dark"] .form-control:focus {
  border-color: var(--verde-hover-dark);
  box-shadow: 0 0 0 3px rgba(84, 139, 59, 0.2);
}

[data-theme="dark"] .contacto-info {
  background: var(--bg-dark-card);
  border: 1px solid var(--verde-principal-dark);
}

[data-theme="dark"] .contacto-info h3 {
  color: var(--verde-principal-dark);
}

[data-theme="dark"] .contacto-info p,
[data-theme="dark"] .contacto-info a {
  color: var(--text-dark-secondary);
}

/* ===== FAQ ===== */

[data-theme="dark"] .faq-section {
  background: linear-gradient(180deg, var(--bg-dark) 0%, var(--bg-dark-secondary) 100%);
}

[data-theme="dark"] .faq-section .section-title h2 {
  color: var(--verde-principal-dark);
}

[data-theme="dark"] .faq-item {
  background: var(--bg-dark-card);
  border: 1px solid var(--verde-principal-dark);
}

[data-theme="dark"] .faq-question {
  color: var(--text-dark-primary);
}

[data-theme="dark"] .faq-answer {
  color: var(--text-dark-secondary);
}

/* ===== RESPONSIVE ===== */

@media (max-width: 768px) {
  [data-theme="dark"] .dark-mode-toggle {
    top: 70px;
    right: 10px;
    padding: 10px 14px;
  }
}

/* ===== VIDEO MODAL ===== */

.video-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.video-modal.active {
  opacity: 1;
  visibility: visible;
}

.video-modal-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
}

.video-modal-close {
  position: absolute;
  top: -40px;
  right: 0;
  background: transparent;
  border: none;
  color: white;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.2rem;
  font-weight: 600;
  transition: all 0.3s ease;
}

.video-modal-close:hover {
  color: var(--verde-principal-dark);
  transform: scale(1.1);
}

.video-container {
  background: #000;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 0 50px rgba(84, 139, 59, 0.3);
}

.video-container video {
  max-width: 100%;
  max-height: 80vh;
  display: block;
}

/* Logo con cursor pointer y efectos */
.logo {
  cursor: pointer;
  transition: all 0.3s ease;
}

.logo:hover {
  transform: scale(1.02);
}

.logo:hover img {
  filter: brightness(1.2);
  transform: rotate(-2deg);
}

/* Modal osuro específico */
[data-theme="dark"] .video-modal {
  background: rgba(0, 0, 0, 0.95);
}

[data-theme="dark"] .video-modal-close {
  color: var(--text-dark-primary);
}

[data-theme="dark"] .video-modal-close:hover {
  color: var(--verde-principal-dark);
}

[data-theme="dark"] .video-container {
  box-shadow: 0 0 60px rgba(84, 139, 59, 0.4);
}