/* Variables Globales e Identidad Institucional */
:root {
  /* Paleta Corporativa no-oficial */
  --cn-dark-blue: #0F172A;
  --cn-white: #FFFFFF;
  --cn-soft-black: #000000;
  --cn-blue-primary: #3B82F6;
  --cn-blue-cyan: #37CEF8;
  --cn-cyan-light: #CCEEFD;
  --cn-cyan-pale: #B3E6FC;
  --cn-yellow-gold: #FACC15;
  --cn-orange-warm: #FBA061;
  --cn-blue-nest-top: #38BDF8;
  --cn-blue-nest-bottom: #60A5FA;

  /* Gradientes no-oficial */
  --cn-gradient-nest: linear-gradient(135deg, #38BDF8 0%, #60A5FA 100%);
  --cn-gradient-accent: linear-gradient(135deg, #FACC15 0%, #FBA061 100%);
  --cn-gradient-dark: linear-gradient(180deg, #0F172A 0%, #1E293B 100%);

  /* Tipografía */
  --cn-font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  /* Espaciados y Sombras */
  --cn-radius-sm: 8px;
  --cn-radius-md: 12px;
  --cn-radius-lg: 16px;
  --cn-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.1), 0 8px 10px -6px rgba(15, 23, 42, 0.1);
  --cn-shadow-glow: 0 0 20px rgba(59, 130, 246, 0.25);
}

* {
  box-sizing: border-box;
}

body {
  font-family: var(--cn-font-family);
  color: #334155;
  background-color: #F8FAFC;
  line-height: 1.6;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 1rem;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--cn-font-family);
  font-weight: 700;
  color: var(--cn-dark-blue);
  line-height: 1.25;
}

a {
  text-decoration: none;
  transition: all 0.25s ease-in-out;
}

img {
  max-width: 100%;
  height: auto;
}

/* Estructura Semántica: Header Institucional y Barra Superior */
.top-notice-bar {
  background: var(--cn-dark-blue);
  color: var(--cn-cyan-light);
  font-size: 0.85rem;
  padding: 6px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.top-notice-bar .badge-highlight {
  background: var(--cn-gradient-accent);
  color: var(--cn-dark-blue);
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
}

/* (<nav>) */
.main-navigation {
  background: rgba(15, 23, 42, 0.96);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 1030;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  border-bottom: 2px solid rgba(59, 130, 246, 0.2);
}

.brand-logo-container {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo-container img {
  height: 48px;
  width: auto;
  border-radius: 8px;
  object-fit: contain;
}

.brand-title {
  color: var(--cn-white);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.brand-title .nest-gradient {
  background: var(--cn-gradient-nest);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.nav-link {
  color: #CBD5E1 !important;
  font-weight: 500;
  font-size: 0.95rem;
  padding: 8px 16px !important;
  border-radius: var(--cn-radius-sm);
  transition: all 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
  color: var(--cn-white) !important;
  background: rgba(59, 130, 246, 0.15);
  box-shadow: inset 0 -2px 0 var(--cn-blue-cyan);
}

.btn-nav-cta {
  background: var(--cn-gradient-nest);
  color: var(--cn-dark-blue);
  font-weight: 700;
  border: none;
  padding: 8px 20px;
  border-radius: var(--cn-radius-sm);
  box-shadow: 0 4px 12px rgba(56, 189, 248, 0.3);
}

.btn-nav-cta:hover {
  background: linear-gradient(135deg, #60A5FA 0%, #38BDF8 100%);
  color: var(--cn-dark-blue);
  transform: translateY(-1px);
}

/* (<main>) */
main {
  flex: 1;
}

/* (<section>) */
.section-header {
  margin-bottom: 2.5rem;
  position: relative;
}

.section-tag {
  display: inline-block;
  color: var(--cn-blue-primary);
  background: rgba(59, 130, 246, 0.1);
  padding: 4px 14px;
  border-radius: 20px;
  font-size: 0.825rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 0.75rem;
}

.section-title {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  margin-bottom: 0.75rem;
}

.section-subtitle {
  color: #64748B;
  font-size: 1.1rem;
  max-width: 650px;
}

/* Secciones de Portada / Hero */
.hero-section {
  background: var(--cn-gradient-dark);
  color: var(--cn-white);
  padding: 5rem 0 4rem;
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid rgba(59, 130, 246, 0.2);
}

.hero-section::before {
  content: '';
  position: absolute;
  top: -20%;
  right: -10%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.15) 0%, rgba(15, 23, 42, 0) 70%);
  border-radius: 50%;
  pointer-events: none;
}

.hero-title {
  color: var(--cn-white);
  font-size: clamp(2.2rem, 5vw, 3.75rem);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 1.25rem;
  overflow-wrap: anywhere;
}

.hero-highlight {
  background: var(--cn-gradient-nest);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  color: #94A3B8;
  font-size: 1.2rem;
  margin-bottom: 2rem;
  max-width: 580px;
}

/* (<article>) */
.semantic-card {
  background: var(--cn-white);
  border-radius: var(--cn-radius-md);
  border: 1px solid #E2E8F0;
  padding: 1.75rem;
  transition: all 0.3s ease;
  height: 100%;
  display: flex;
  flex-direction: column;
  position: relative;
}

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

.card-icon-badge {
  width: 50px;
  height: 50px;
  border-radius: var(--cn-radius-sm);
  background: rgba(59, 130, 246, 0.1);
  color: var(--cn-blue-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 1.25rem;
}

.semantic-card-footer {
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid #F1F5F9;
}

/* (<aside>) */
.semantic-aside {
  background: #F1F5F9;
  border: 1px solid #CBD5E1;
  border-left: 4px solid var(--cn-blue-primary);
  border-radius: var(--cn-radius-sm);
  padding: 1.5rem;
  margin-top: 1.5rem;
}

.aside-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--cn-dark-blue);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* (<footer>) */
.main-footer {
  background: var(--cn-dark-blue);
  color: #94A3B8;
  padding: 4rem 0 2rem;
  margin-top: auto;
  border-top: 4px solid var(--cn-blue-primary);
}

.footer-brand-desc {
  font-size: 0.95rem;
  line-height: 1.6;
  margin-top: 1rem;
  color: #94A3B8;
}

.footer-heading {
  color: var(--cn-white);
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
  position: relative;
  padding-bottom: 8px;
}

.footer-heading::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 32px;
  height: 2px;
  background: var(--cn-blue-cyan);
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-links li {
  margin-bottom: 0.65rem;
}

.footer-links a {
  color: #94A3B8;
  font-size: 0.9rem;
}

.footer-links a:hover {
  color: var(--cn-cyan-light);
  padding-left: 4px;
}

.footer-bottom {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.85rem;
}

/* Badges y botones complementarios */
.badge-code {
  background: #0F172A;
  color: #38BDF8;
  font-family: monospace;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.8rem;
}

.btn-brand-primary {
  background: var(--cn-blue-primary);
  color: var(--cn-white);
  border: none;
  padding: 10px 24px;
  font-weight: 600;
  border-radius: var(--cn-radius-sm);
  transition: all 0.25s ease;
}

.btn-brand-primary:hover {
  background: #2563EB;
  color: var(--cn-white);
  box-shadow: var(--cn-shadow-glow);
}

.btn-brand-outline {
  background: transparent;
  color: var(--cn-white);
  border: 2px solid rgba(255, 255, 255, 0.3);
  padding: 9px 22px;
  font-weight: 600;
  border-radius: var(--cn-radius-sm);
  transition: all 0.25s ease;
}

.btn-brand-outline:hover {
  border-color: var(--cn-white);
  background: rgba(255, 255, 255, 0.1);
  color: var(--cn-white);
}

.brand-logo-image {
  display: block;
  width: min(100%, 24rem);
  margin-inline: auto;
  height: auto;
}

.identity-swatch {
  display: inline-block;
  width: 2rem;
  height: 2rem;
  flex: 0 0 2rem;
  border: 1px solid rgba(15, 23, 42, 0.18);
  border-radius: 0.4rem;
  vertical-align: middle;
}

.identity-variant {
  display: flex;
  height: 100%;
  min-height: 15rem;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  border: 1px solid #e2e8f0;
  border-radius: var(--cn-radius-md);
  background: #f8fafc;
}

.identity-variant img {
  max-height: 15rem;
  width: 100%;
  object-fit: contain;
}

.form-status {
  border-radius: var(--cn-radius-sm);
}

.form-status.alert-success {
  color: #14532d;
}

.form-status.alert-danger {
  color: #7f1d1d;
}

.blog-article-details summary {
  color: var(--cn-blue-primary);
  cursor: pointer;
  font-weight: 700;
}

.blog-article-details[open] summary {
  margin-bottom: 0.75rem;
}

:focus-visible {
  outline: 3px solid var(--cn-blue-primary);
  outline-offset: 3px;
}

@media (max-width: 1199.98px) {
  .main-navigation .navbar-nav {
    align-items: stretch !important;
    padding-top: 0.5rem;
  }

  .main-navigation .nav-link {
    padding-inline: 0.75rem !important;
  }

  .main-navigation .btn-nav-cta {
    display: inline-block;
    text-align: center;
  }

  .semantic-card:hover {
    transform: none;
  }
}

@media (min-width: 768px) and (max-width: 991.98px) {
  .hero-section {
    padding: 3.5rem 0;
  }

  .hero-section .row {
    align-items: flex-start;
  }
}

@media (max-width: 767.98px) {
  .top-notice-bar {
    font-size: 0.75rem;
    line-height: 1.4;
  }

  .hero-section {
    padding: 3.25rem 0;
  }

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

  .section-title {
    overflow-wrap: anywhere;
  }

  .semantic-card {
    padding: 1.35rem;
  }

  .main-footer {
    padding-top: 3rem;
  }

  .footer-bottom {
    align-items: flex-start !important;
  }
}

@media (max-width: 575.98px) {
  .top-notice-bar .container > div:first-child {
    align-items: flex-start !important;
  }

  .top-notice-bar .badge-highlight {
    flex: 0 0 auto;
  }

  .hero-section .btn {
    width: 100%;
  }

  .table-responsive {
    font-size: 0.9rem;
  }

  .identity-variant {
    min-height: 11rem;
  }

  .identity-variant img {
    max-height: 11rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}