* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* Colores Gubernamentales */
  --guinda-primary: #6b7280;
  --guinda-dark: #2f2f2f;
  --guinda-light: #1e40af;
  --negro-neutral: #151818;
  --gris-oscuro: #2f2f2f;
  --gris-medio: #6b7280;
  --gris-claro: #f3f4f6;
  --blanco: #ffffff;
  --verde-institucional: #16a34a;
  --azul-gobierno: #1e40af;
  --amarillo-advertencia: #fbbf24;
  --rojo-error: #dc2626;

  /* Tipografía */
  --font-serif: "Crimson Text", Georgia, serif;
  --font-sans: "Inter", "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;

  /* Espaciado */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  --space-3xl: 64px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.15);
}

a {
  text-decoration: none;
  transition: all 0.3s ease;
}

body {
  font-family: var(--font-sans);
  background: linear-gradient(135deg, var(--gris-claro) 0%, #e5e7eb 100%);
  color: var(--negro-neutral);
  line-height: 1.6;
  min-height: 100vh;
}

/* Floating Background - Mejorado */
.bg-decoration {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: 0;
  background: linear-gradient(45deg,
      rgba(102, 6, 62, 0.02) 0%,
      rgba(30, 64, 175, 0.02) 100%);
}

.floating-document {
  position: absolute;
  opacity: 0.08;
  animation: floatUp linear infinite;
  user-select: none;
  pointer-events: none;
  filter: drop-shadow(0 2px 4px rgba(102, 6, 62, 0.1));
}

.floating-document img {
  width: 50px;
  height: auto;
  display: block;
  filter: grayscale(0.3);
}

.floating-document.large img {
  width: 60px;
  opacity: 0.06;
}

.floating-document.medium img {
  width: 45px;
  opacity: 0.08;
}

.floating-document.small img {
  width: 35px;
  opacity: 0.1;
}

@keyframes floatUp {
  0% {
    transform: translateY(100vh) rotate(0deg) scale(0.8);
    opacity: 0;
  }

  10% {
    opacity: 0.08;
    transform: translateY(90vh) rotate(20deg) scale(1);
  }

  90% {
    opacity: 0.08;
    transform: translateY(-50px) rotate(340deg) scale(1);
  }

  100% {
    transform: translateY(-100px) rotate(360deg) scale(0.8);
    opacity: 0;
  }
}

.float-slow {
  animation-duration: 28s;
}

.float-medium {
  animation-duration: 22s;
}

.float-fast {
  animation-duration: 18s;
}

.float-very-slow {
  animation-duration: 35s;
}

/* Header Gubernamental */
.header {
  background: linear-gradient(135deg,
      var(--guinda-primary) 0%,
      var(--guinda-dark) 100%);
  padding: var(--space-md) 0;
  box-shadow: var(--shadow-lg);
  position: relative;
  z-index: 10;
  border-bottom: 3px solid var(--amarillo-advertencia);
}

.header::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg,
      var(--amarillo-advertencia),
      var(--verde-institucional),
      var(--azul-gobierno));
}

.header-img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
  filter: brightness(1.1) contrast(1.05);
}

/* Hero Section */
.hero-section {
  background: linear-gradient(135deg, var(--blanco) 0%, var(--gris-claro) 100%);
  padding: var(--space-3xl) 0;
  position: relative;
  z-index: 1;
  border-bottom: 1px solid #e5e7eb;
}

.hero-content {
  text-align: center;
  max-width: 800px;
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.hero-title {
  font-family: var(--font-serif);
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--guinda-primary);
  margin-bottom: var(--space-lg);
  line-height: 1.2;
  text-shadow: 0 2px 4px rgba(102, 6, 62, 0.1);
}

.hero-subtitle {
  font-size: 1.125rem;
  color: var(--gris-oscuro);
  font-weight: 400;
  line-height: 1.7;
  opacity: 0.9;
}

/* Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-lg);
  position: relative;
  z-index: 1;
}

main {
  background: var(--blanco);
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: var(--space-2xl);
  padding: var(--space-3xl) var(--space-lg);
  margin: 0 auto;
  max-width: 1200px;
  box-shadow: var(--shadow-xl);
  border-radius: 12px 12px 0 0;
  margin-top: -20px;
}

/* Cards Section */
.cards-section {
  flex: 1;
}

.cards-container {
  display: grid;
  gap: var(--space-lg);
  padding: 0;
}

/* Full Width Card */
.card__full-width {
  background: linear-gradient(135deg, var(--blanco) 0%, #f8fafc 100%);
  border-radius: 12px;
  padding: var(--space-2xl);
  box-shadow: var(--shadow-md);
  border: 1px solid #e2e8f0;
  border-left: 4px solid var(--guinda-primary);
  margin-bottom: var(--space-xl);
  transition: all 0.3s ease;
}

.card__full-width:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.card__full-width .card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, var(--amarillo-advertencia), #f59e0b);
  border-radius: 12px;
  margin-bottom: var(--space-lg);
  box-shadow: var(--shadow-sm);
}

.card__full-width .card-icon img {
  width: 32px;
  height: 32px;
  filter: brightness(0) invert(1);
}

.card__full-width .card-title {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--negro-neutral);
  margin-bottom: var(--space-lg);
  line-height: 1.4;
}

.card-img-container {
  display: flex;
  gap: var(--space-lg);
  margin: var(--space-lg) 0;
  justify-content: space-around;
  flex-wrap: wrap;
  align-items: baseline;
}

.card-img {
  display: block;
  transition: all 0.3s ease;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.card-img:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: var(--shadow-lg);
}

.card-img img {
  max-width: 200px;
  height: auto;
  display: block;
  border-radius: 8px;
}

.card__full-width .card-text {
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  padding: var(--space-lg);
  border-radius: 8px;
  border-left: 4px solid var(--amarillo-advertencia);
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--gris-oscuro);
  margin-top: var(--space-lg);
}

/* Regular Cards */
.card {
  background: linear-gradient(135deg, var(--blanco) 0%, #fafbfc 100%);
  border-radius: 12px;
  padding: var(--space-xl);
  box-shadow: var(--shadow-sm);
  border: 1px solid #e2e8f0;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg,
      var(--guinda-primary),
      var(--azul-gobierno));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--guinda-primary);
}

.card:hover::before {
  opacity: 1;
}

.card a {
  color: inherit;
  display: block;
  height: 100%;
}

.card .card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  background: linear-gradient(135deg,
      var(--guinda-primary),
      var(--guinda-light));
  border-radius: 10px;
  margin-bottom: var(--space-lg);
  box-shadow: var(--shadow-sm);
}

.card .card-icon img {
  width: 24px;
  height: 24px;
  filter: brightness(0) invert(1);
}

.card .card-title {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--negro-neutral);
  margin-bottom: var(--space-md);
  line-height: 1.4;
}

.card .card-text {
  font-size: 0.95rem;
  color: var(--gris-medio);
  line-height: 1.6;
}

/* Aside Section */
.aside-section {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.aside-contador {
  background: linear-gradient(135deg,
      var(--guinda-primary),
      var(--guinda-dark));
  color: var(--blanco);
  padding: var(--space-xl);
  border-radius: 12px;
  text-align: center;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}

.aside-contador::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle,
      rgba(255, 255, 255, 0.1) 0%,
      transparent 70%);
  animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {

  0%,
  100% {
    transform: rotate(0deg);
  }

  50% {
    transform: rotate(180deg);
  }
}

.aside-contador h2 {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: var(--space-md);
  position: relative;
  z-index: 1;
}

.aside-contador p {
  font-size: 1rem;
  opacity: 0.9;
  position: relative;
  z-index: 1;
}

.aside-publicidad {
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: all 0.3s ease;
  background: var(--blanco);
  border: 1px solid #e2e8f0;
}

.aside-publicidad:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.aside-publicidad-link {
  display: block;
  width: 100%;
  height: 100%;
}

.aside-publicidad-img {
  width: 100%;
  height: auto;
  display: block;
  transition: all 0.3s ease;
}

.aside-publicidad:hover .aside-publicidad-img {
  transform: scale(1.02);
}

/* Footer */
.footer {
  background: linear-gradient(135deg,
      var(--negro-neutral) 0%,
      var(--gris-oscuro) 100%);
  color: var(--blanco);
  padding: var(--space-3xl) 0 var(--space-xl);
  margin-top: var(--space-3xl);
  position: relative;
  z-index: 1;
}

.footer::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg,
      var(--guinda-primary),
      var(--azul-gobierno),
      var(--verde-institucional));
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--space-2xl);
  margin-bottom: var(--space-xl);
}

.footer-section h3 {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--amarillo-advertencia);
  margin-bottom: var(--space-lg);
}

.footer-section ul {
  list-style: none;
}

.footer-section li {
  margin-bottom: var(--space-sm);
  color: #cbd5e0;
  font-size: 0.95rem;
}

.footer-bottom {
  border-top: 1px solid var(--gris-medio);
  padding-top: var(--space-lg);
  text-align: center;
}

.footer-bottom a {
  color: var(--amarillo-advertencia);
  font-size: 0.875rem;
  text-decoration: none;
}

.footer-bottom a:hover {
  color: var(--gris-claro);
}

/* Responsive Design */
@media (max-width: 1024px) {
  main {
    grid-template-columns: 1fr;
    gap: var(--space-xl);
  }

  .hero-title {
    font-size: 2rem;
  }

  .card-img-container {
    justify-content: center;
  }

  .card-img img {
    max-width: 150px;
  }
}

@media (max-width: 768px) {
  .hero-title {
    font-size: 1.75rem;
  }

  .hero-subtitle {
    font-size: 1rem;
  }

  main {
    padding: var(--space-xl) var(--space-md);
    margin-top: -10px;
  }

  .card__full-width {
    padding: var(--space-xl);
  }

  .card {
    padding: var(--space-lg);
  }

  .card-img-container {
    flex-direction: column;
    align-items: center;
  }
}

@media (max-width: 480px) {
  :root {
    --space-3xl: 48px;
    --space-2xl: 32px;
  }

  .hero-content {
    padding: 0 var(--space-md);
  }

  .footer-content {
    grid-template-columns: 1fr;
    gap: var(--space-xl);
  }
}

/* Accessibility Improvements */
@media (prefers-reduced-motion: reduce) {
  .floating-document {
    animation: none;
  }

  .aside-contador::before {
    animation: none;
  }

  * {
    transition: none !important;
  }
}

/* Focus States */
a:focus,
button:focus {
  outline: 2px solid var(--azul-gobierno);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Print Styles */
@media print {

  .bg-decoration,
  .aside-section {
    display: none;
  }

  body {
    background: white;
    color: black;
  }

  .header {
    background: white;
    color: black;
  }
}

.aside-contador {
  background: linear-gradient(135deg,
      var(--guinda-primary) 0%,
      var(--guinda-dark) 100%);
  color: var(--blanco);
  padding: var(--space-2xl);
  border-radius: 16px;
  text-align: center;
  box-shadow: var(--shadow-xl);
  position: relative;
  overflow: hidden;
  transition: all 0.4s ease;
  border: 2px solid rgba(255, 255, 255, 0.1);
}

.aside-contador:hover {
  transform: translateY(-4px);
  box-shadow: 0 25px 50px rgba(102, 6, 62, 0.3);
  border-color: rgba(255, 255, 255, 0.2);
}

/* Fondo animado */
.aside-contador::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: conic-gradient(from 0deg,
      transparent,
      rgba(251, 191, 36, 0.1),
      rgba(22, 163, 74, 0.1),
      rgba(30, 64, 175, 0.1),
      transparent);
  animation: rotate 8s linear infinite;
  z-index: 1;
}

.aside-contador::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg,
      var(--amarillo-advertencia),
      var(--verde-institucional),
      var(--azul-gobierno));
  border-radius: 16px 16px 0 0;
  z-index: 3;
}

@keyframes rotate {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

/* Contenido */
.aside-contador>* {
  position: relative;
  z-index: 4;
}

.aside-contador h2 {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 600;
  margin: 0 0 var(--space-lg) 0;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  line-height: 1.3;
}

.aside-contador .counter {
  display: block;
  font-family: var(--font-sans);
  font-size: 4rem;
  font-weight: 800;
  color: var(--amarillo-advertencia);
  text-shadow:
    0 0 10px rgba(251, 191, 36, 0.5),
    0 4px 8px rgba(0, 0, 0, 0.3);
  margin: var(--space-lg) 0;
  line-height: 1;
  position: relative;
  animation: glow 3s ease-in-out infinite alternate;
}

@keyframes glow {
  0% {
    text-shadow:
      0 0 10px rgba(251, 191, 36, 0.5),
      0 4px 8px rgba(0, 0, 0, 0.3);
  }

  100% {
    text-shadow:
      0 0 20px rgba(251, 191, 36, 0.8),
      0 0 30px rgba(251, 191, 36, 0.4),
      0 4px 8px rgba(0, 0, 0, 0.3);
  }
}

.aside-contador .counter::before {
  content: "";
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 80%;
  height: 2px;
  background: linear-gradient(90deg,
      transparent,
      var(--amarillo-advertencia),
      transparent);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {

  0%,
  100% {
    opacity: 0.5;
    transform: translateX(-50%) scaleX(0.8);
  }

  50% {
    opacity: 1;
    transform: translateX(-50%) scaleX(1.2);
  }
}

.aside-contador h3 {
  font-family: var(--font-sans);
  font-size: 1.125rem;
  font-weight: 500;
  margin: var(--space-lg) 0 0 0;
  opacity: 0.9;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* Responsive */
@media (max-width: 768px) {
  .aside-contador {
    padding: var(--space-xl);
    border-radius: 12px;
  }

  .aside-contador h2 {
    font-size: 1.25rem;
  }

  .aside-contador .counter {
    font-size: 3rem;
  }

  .aside-contador h3 {
    font-size: 1rem;
  }
}

@media (max-width: 480px) {
  .aside-contador {
    padding: var(--space-lg);
  }

  .aside-contador h2 {
    font-size: 1.125rem;
  }

  .aside-contador .counter {
    font-size: 2.5rem;
  }
}

/* Accesibilidad */
@media (prefers-reduced-motion: reduce) {

  .aside-contador,
  .aside-contador::before,
  .aside-contador .counter,
  .aside-contador .counter::before {
    animation: none !important;
    transition: none !important;
  }
}

/* Breadcrumb */
.breadcrumb {
  background: var(--blanco);
  padding: var(--space-sm) 0;
  font-size: 0.95rem;
  position: relative;
  z-index: 5;
}

.breadcrumb ol {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin: 0;
  padding: 0;
}

.breadcrumb li {
  color: var(--gris-medio);
  display: flex;
  align-items: center;
}

.breadcrumb li a {
  color: var(--guinda-light);
  font-weight: 500;
}

.breadcrumb li a:hover {
  text-decoration: underline;
  color: var(--azul-gobierno);
}

.breadcrumb li::after {
  content: "›";
  margin-left: var(--space-sm);
  margin-right: var(--space-sm);
  color: var(--gris-medio);
}

.breadcrumb li:last-child {
  font-weight: 600;
  color: var(--negro-neutral);
}

.breadcrumb li:last-child::after {
  content: "";
}

/* CSS para el botón de scroll to top */
.scroll-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 56px;
  height: 56px;
  background: linear-gradient(var(--gris-claro), #e5e7eb);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow:
    0 10px 15px rgba(0, 0, 0, 0.1),
    0 4px 6px rgba(0, 0, 0, 0.07);
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: all 0.3s ease;
  z-index: 1000;
  border: 2px solid var(--gris-claro);
}

.scroll-to-top.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.scroll-to-top:hover {
  background: linear-gradient(var(--gris-oscuro), var(--gris-medio));
  transform: translateY(-4px);
  box-shadow:
    0 20px 25px rgba(0, 0, 0, 0.15),
    0 10px 15px rgba(102, 6, 62, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

.scroll-to-top:active {
  transform: translateY(-2px);
}

.scroll-to-top::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gris-claro), var(--gris-oscuro));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.scroll-to-top:hover::before {
  opacity: 1;
  animation: rotate-border 3s linear infinite;
}

@keyframes rotate-border {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

/* Flecha SVG */
.scroll-to-top svg {
  width: 24px;
  height: 24px;
  position: relative;
  z-index: 1;
}

.scroll-to-top svg path {
  fill: #ffffff;
  transition: all 0.3s ease;
}

.scroll-to-top:hover svg path {
  fill: #fbbf24;
}

/* Animación de la flecha */
.scroll-to-top:hover svg {
  animation: arrow-bounce 0.6s ease-in-out infinite;
}

@keyframes arrow-bounce {

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

  50% {
    transform: translateY(-4px);
  }
}

/* Focus para accesibilidad */
.scroll-to-top:focus {
  outline: 2px solid #1e40af;
  outline-offset: 3px;
}

/* Responsive */
@media (max-width: 768px) {
  .scroll-to-top {
    width: 48px;
    height: 48px;
    bottom: 20px;
    right: 20px;
  }

  .scroll-to-top svg {
    width: 20px;
    height: 20px;
  }
}
