/* Componentes visuales reutilizables del sitio.
   Fuente única de verdad para: reset base, tipografía global, variables CSS,
   navbar, layout interno, sistema de decoraciones y botones compartidos entre
   TODAS las vistas (landing, pagos, tutoriales, descargas y páginas de error).
   Dependencias: Google Fonts (Oswald, Open Sans). */

/* ===========================================
   VARIABLES GLOBALES
   =========================================== */
:root {
  --color-primary: #00A8B5;
  --color-dark: #003E5C;
  --color-light-bg: #E0F7FA;
  --color-white: #FFFFFF;
  --color-secondary: #F5F5F5;
  --color-whatsapp: #25D366;
  --color-text-muted: #666666;
  --color-text-secondary: #555555;
  --color-text-dark: #444444;
  --color-error-bg: #FFE6E6;
  --color-error-text: #7a1f1f;
  --color-error-border: #e5a4a4;
  --color-warning-bg: #fff7d6;
  --color-warning-text: #5a4b00;
  --color-warning-border: #e8d890;
  --color-input-border: #cccccc;
  --color-table-header: #f1f6f7;
  --color-table-border: #d8e5e8;
  --sombra: 0 4px 20px rgba(0, 0, 0, 0.1);
  --sombra-hover: 0 8px 30px rgba(0, 0, 0, 0.15);
  --sombra-card: 0 24px 60px rgba(0, 0, 0, 0.18);
  --transicion: all 0.3s ease;
}

/* ===========================================
   RESET BASE Y TIPOGRAFÍA GLOBAL
   =========================================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Open Sans', sans-serif;
  font-weight: 400;
  line-height: 1.6;
  color: var(--color-dark);
  background-color: var(--color-white);
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: 'Oswald', sans-serif;
  font-weight: 700;
  text-transform: uppercase;
  line-height: 1.2;
}

a {
  text-decoration: none;
  color: inherit;
  transition: var(--transicion);
}

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

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ===========================================
   NAVBAR COMPARTIDO
   =========================================== */
#navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: linear-gradient(to right, var(--color-light-bg), var(--color-primary));
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  transition: var(--transicion);
}

#navbar.scrolled {
  background: linear-gradient(to right, var(--color-light-bg), var(--color-primary));
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo img {
  height: 45px;
  width: auto;
  transition: var(--transicion);
}

.logo:hover img {
  transform: scale(1.05);
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 8px;
  align-items: center;
}

.nav-links li {
  position: relative;
}

.nav-links a {
  font-family: 'Open Sans', sans-serif;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--color-dark);
  padding: 10px 16px;
  border-radius: 25px;
  transition: var(--transicion);
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: 6px;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--color-primary);
  transition: var(--transicion);
  transform: translateX(-50%);
}

.nav-links a:hover::after {
  width: 60%;
}

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

.nav-links a.active {
  background: var(--color-primary);
  color: var(--color-white);
}

.nav-links a.active::after {
  display: none;
}

.nav-dropdown-toggle {
  font-family: 'Open Sans', sans-serif;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--color-dark);
  padding: 10px 16px;
  border: none;
  border-radius: 25px;
  background: transparent;
  transition: var(--transicion);
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.nav-dropdown-toggle::after {
  content: '';
  width: 8px;
  height: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-1px);
  transition: transform 0.2s ease;
}

.nav-dropdown-toggle:hover,
.nav-dropdown-toggle:focus-visible,
.nav-dropdown.is-open .nav-dropdown-toggle,
.nav-dropdown:hover .nav-dropdown-toggle,
.nav-dropdown:focus-within .nav-dropdown-toggle {
  color: var(--color-primary);
}

.nav-dropdown-toggle:focus-visible {
  outline: 2px solid rgba(0, 168, 181, 0.35);
  outline-offset: 2px;
}

.nav-dropdown::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  height: 14px;
}

.nav-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 200px;
  margin: 0;
  padding: 10px;
  list-style: none;
  background: rgba(255, 255, 255, 0.98);
  border-radius: 16px;
  box-shadow: 0 16px 40px rgba(0, 62, 92, 0.14);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
}

.nav-dropdown-menu li {
  border-bottom: none;
}

.nav-dropdown-menu a {
  display: block;
  padding: 12px 14px;
  border-radius: 12px;
}

.nav-dropdown-menu a:hover {
  background: var(--color-light-bg);
}

.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown:focus-within .nav-dropdown-menu,
.nav-dropdown.is-open .nav-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

.nav-dropdown:hover .nav-dropdown-toggle::after,
.nav-dropdown:focus-within .nav-dropdown-toggle::after,
.nav-dropdown.is-open .nav-dropdown-toggle::after {
  transform: rotate(-135deg) translate(-1px, -1px);
}

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 10px;
}

.hamburger span {
  width: 25px;
  height: 3px;
  background-color: var(--color-dark);
  border-radius: 3px;
  transition: var(--transicion);
}

/* ===========================================
   BOTONES COMPARTIDOS
   =========================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 24px;
  font-family: 'Oswald', sans-serif;
  font-size: 1.1rem;
  text-transform: uppercase;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: var(--transicion);
  text-decoration: none;
}

.btn-primary {
  background-color: var(--color-primary);
  color: var(--color-white);
  box-shadow: var(--sombra);
}

.btn-primary:hover {
  background-color: var(--color-dark);
  color: var(--color-white);
  transform: translateY(-3px);
  box-shadow: var(--sombra-hover);
}

.btn-secondary {
  background-color: transparent;
  color: var(--color-primary);
  border: 2px solid var(--color-primary);
}

.btn-secondary:hover {
  background-color: var(--color-primary);
  color: var(--color-white);
  transform: translateY(-3px);
}

.btn-whatsapp {
  background-color: var(--color-whatsapp);
  color: var(--color-white);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 30px;
}

.btn-whatsapp img {
  width: 24px;
  height: 24px;
}

.btn-whatsapp:hover {
  background-color: var(--color-whatsapp);
  transform: translateY(-3px);
}


/* ===========================================
   LAYOUT INTERNO COMPARTIDO
   =========================================== */
.layout-internal-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.layout-internal-main {
  flex: 1;
  padding-top: 90px;
}

.container-narrow {
  max-width: 900px;
}

.container-medium {
  max-width: 820px;
}

.text-center {
  text-align: center;
}

.internal-hero-section {
  padding: 70px 0 40px;
}

.internal-section-tight-top {
  padding-top: 30px;
}

.internal-section-standard-top {
  padding-top: 70px;
}

.centered-block {
  margin: 0 auto;
}

.margin-top-30 {
  margin-top: 30px;
}

.section-title {
  font-size: 2.5rem;
  text-align: center;
  margin-bottom: 20px;
  color: var(--color-dark);
  position: relative;
  z-index: 1;
}

.section-title.light {
  color: var(--color-white);
}

.section-subtitle {
  text-align: center;
  font-size: 1.1rem;
  color: var(--color-text-muted);
  margin-bottom: 50px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.section-subtitle.light {
  color: rgba(255, 255, 255, 0.9);
}

.portal-description {
  text-align: center;
  font-size: 1.1rem;
  color: var(--color-text-secondary);
  max-width: 700px;
  margin: 0 auto;
}

.margin-bottom-26 {
  margin-bottom: 26px;
}

/* ===========================================
   FONDOS INSTITUCIONALES
   =========================================== */
.bg-institutional-gradient {
  background: linear-gradient(160deg, var(--color-dark) 0%, var(--color-primary) 100%);
}

.bg-section-alt {
  background-color: var(--color-light-bg);
}

.bg-decoration-canvas {
  position: relative;
  overflow: hidden;
}

.section-content-layer {
  position: relative;
  z-index: 1;
}

/* ===========================================
   SISTEMA DE DECORACIONES
   Clases base reutilizables en TODAS las vistas.
   El hero de la landing sobreescribe con contexto #hero en main.css.
   =========================================== */

/* Base común */
.dots-pattern,
.hero-circle,
.decoration-circle,
.decoration-dots,
.decoration-bar,
.section-decoration {
  position: absolute;
  z-index: 0;
  pointer-events: none;
}

/* --- Patrón de puntos --- */
.dots-pattern {
  width: 120px;
  height: 120px;
  background-image: radial-gradient(circle, rgba(255, 255, 255, 0.28) 2px, transparent 2px);
  background-size: 15px 15px;
}

.dots-top-left {
  top: 8%;
  left: 4%;
}

.dots-bottom-right {
  bottom: 10%;
  right: 4%;
  width: 150px;
  height: 150px;
}

.dots-middle-left {
  top: 60%;
  left: 8%;
  width: 80px;
  height: 80px;
  background-size: 12px 12px;
}

/* --- Círculos base --- */
.hero-circle {
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.18);
}

.hero-circle-1 {
  width: 120px;
  height: 120px;
  top: 16%;
  right: 18%;
}

.hero-circle-2 {
  width: 80px;
  height: 80px;
  bottom: 18%;
  left: 18%;
}

.hero-circle-3 {
  width: 160px;
  height: 160px;
  top: 55%;
  right: 6%;
  border-color: rgba(255, 255, 255, 0.12);
}

/* --- Círculos semánticos --- */
.decoration-circle {
  border-radius: 50%;
}

.decoration-circle.circle-outline {
  width: 120px;
  height: 120px;
  border: 3px solid var(--color-primary);
  opacity: 0.15;
}

.decoration-circle.circle-filled {
  width: 80px;
  height: 80px;
  background: var(--color-primary);
  opacity: 0.08;
}

.decoration-circle.circle-outline-dark {
  width: 100px;
  height: 100px;
  border: 3px solid var(--color-dark);
  opacity: 0.1;
}

.decoration-circle.circle-light {
  width: 100px;
  height: 100px;
  border: 3px solid rgba(255, 255, 255, 0.3);
}

/* --- Puntos semánticos --- */
.decoration-dots {
  width: 100px;
  height: 100px;
  background-size: 12px 12px;
}

.decoration-dots.dots-turquesa {
  background-image: radial-gradient(circle, var(--color-primary) 2px, transparent 2px);
  opacity: 0.2;
}

.decoration-dots.dots-dark {
  background-image: radial-gradient(circle, var(--color-dark) 2px, transparent 2px);
  opacity: 0.12;
}

.decoration-dots.dots-light {
  background-image: radial-gradient(circle, rgba(255, 255, 255, 0.6) 2px, transparent 2px);
  opacity: 0.4;
}

/* Puntos institucionales para fondos claros */
.section-dots {
  width: 100px;
  height: 100px;
  background-image: radial-gradient(circle, var(--color-primary) 2px, transparent 2px);
  background-size: 14px 14px;
  opacity: 0.15;
}

.section-dots.dots-light {
  background-image: radial-gradient(circle, rgba(255, 255, 255, 0.5) 2px, transparent 2px);
  opacity: 0.3;
}

/* --- Barras semánticas --- */
.section-bar {
  width: 80px;
  height: 5px;
  background: linear-gradient(90deg, var(--color-primary), transparent);
  border-radius: 3px;
}

.decoration-bar.bar-horizontal {
  width: 100px;
  height: 6px;
  background: linear-gradient(90deg, var(--color-primary), transparent);
  border-radius: 3px;
  opacity: 0.3;
}

.decoration-bar.bar-horizontal-dark {
  width: 100px;
  height: 6px;
  background: linear-gradient(90deg, var(--color-dark), transparent);
  border-radius: 3px;
  opacity: 0.15;
}

.decoration-bar.bar-vertical {
  width: 6px;
  height: 80px;
  background: linear-gradient(180deg, var(--color-primary), transparent);
  border-radius: 3px;
  opacity: 0.25;
}

.decoration-bar.bar-light {
  width: 100px;
  height: 6px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.5), transparent);
  border-radius: 3px;
}

/* --- Barras diagonales para secciones --- */
.section-diagonal-bars {
  position: absolute;
  display: flex;
  flex-direction: column;
  gap: 8px;
  opacity: 0.2;
}

.section-diagonal-bars.bars-left {
  left: -20px;
  top: 50%;
  transform: translateY(-50%) rotate(-45deg);
}

.section-diagonal-bars.bars-right {
  right: -20px;
  top: 50%;
  transform: translateY(-50%) rotate(45deg);
}

.section-diagonal-bars .diagonal-bar {
  height: 5px;
  border-radius: 3px;
  background: var(--color-primary);
}

.section-diagonal-bars .diagonal-bar:nth-child(1) {
  width: 60px;
}

.section-diagonal-bars .diagonal-bar:nth-child(2) {
  width: 50px;
}

.section-diagonal-bars .diagonal-bar:nth-child(3) {
  width: 40px;
}

.section-diagonal-bars.bars-dark .diagonal-bar {
  background: var(--color-dark);
}

.section-diagonal-bars.bars-light .diagonal-bar {
  background: rgba(255, 255, 255, 0.4);
}

/* ===========================================
   FOOTER COMPARTIDO — visible en todas las vistas internas
   =========================================== */
footer {
  background-color: var(--color-dark);
  color: var(--color-white);
  padding: 60px 0 20px;
  margin-top: auto;
}

.footer-content {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 40px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-logo {
  width: 150px;
  margin-bottom: 15px;
}

.footer-brand p {
  opacity: 0.8;
}

.footer-links h4,
.footer-contact h4,
.footer-demo h4 {
  font-size: 1.1rem;
  margin-bottom: 20px;
  color: var(--color-primary);
}

.footer-links ul,
.footer-demo ul {
  list-style: none;
}

.footer-links li,
.footer-demo li {
  margin-bottom: 10px;
}

.footer-links a:hover,
.footer-demo a:hover {
  color: var(--color-primary);
}

.footer-contact p {
  margin-bottom: 10px;
  opacity: 0.9;
}

.footer-bottom {
  text-align: center;
  padding-top: 20px;
  opacity: 0.7;
  font-size: 0.9rem;
}

/* ===========================================
   WHATSAPP FLOTANTE — visible en todas las vistas
   =========================================== */
.whatsapp-float {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--color-whatsapp);
  box-shadow: 0 10px 30px rgba(37, 211, 102, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1100;
}

.whatsapp-float:hover {
  transform: translateY(-3px) scale(1.03);
}

.whatsapp-float img {
  width: 28px;
  height: 28px;
}

/* ===========================================
   RESPONSIVE COMPARTIDO
   =========================================== */
@media (max-width: 768px) {
  .hamburger {
    display: flex;
  }

  .nav-links {
    position: fixed;
    top: 69px;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    flex-direction: column;
    align-items: stretch;
    padding: 15px 0;
    gap: 0;
    transform: translateY(-150%);
    transition: transform 0.3s ease;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    max-height: calc(100vh - 69px);
    overflow-y: auto;
  }

  .nav-links.active {
    transform: translateY(0);
  }

  .nav-links li {
    border-bottom: 1px solid rgba(0, 62, 92, 0.08);
  }

  .nav-links li:last-child {
    border-bottom: none;
  }

  .nav-links a {
    color: var(--color-dark);
    padding: 18px 25px;
    width: 100%;
    text-align: left;
    font-size: 1rem;
    border-radius: 0;
    min-height: 56px;
    display: flex;
    align-items: center;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
  }

  .nav-dropdown-toggle {
    color: var(--color-dark);
    padding: 18px 25px;
    width: 100%;
    text-align: left;
    font-size: 1rem;
    border-radius: 0;
    min-height: 56px;
    justify-content: space-between;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
  }

  .nav-dropdown::after {
    display: none;
  }

  .nav-dropdown-menu {
    position: static;
    min-width: 100%;
    padding: 0;
    border-radius: 0;
    box-shadow: none;
    background: rgba(224, 247, 250, 0.55);
    max-height: 0;
    overflow: hidden;
    opacity: 1;
    visibility: visible;
    transform: none;
    pointer-events: auto;
    transition: max-height 0.25s ease;
  }

  .nav-dropdown-menu li:last-child {
    border-bottom: none;
  }

  .nav-dropdown-menu a {
    padding: 16px 40px;
    border-radius: 0;
    min-height: auto;
    font-size: 0.95rem;
  }

  .nav-dropdown.is-open .nav-dropdown-menu {
    max-height: 220px;
  }

  .nav-dropdown:hover .nav-dropdown-menu,
  .nav-dropdown:focus-within .nav-dropdown-menu {
    max-height: 220px;
  }

  .nav-dropdown:hover .nav-dropdown-toggle,
  .nav-dropdown:focus-within .nav-dropdown-toggle,
  .nav-dropdown.is-open .nav-dropdown-toggle {
    background-color: var(--color-light-bg);
    color: var(--color-primary);
  }

  .nav-links a::after {
    display: none;
  }

  .nav-dropdown-toggle::after {
    width: 10px;
    height: 10px;
  }

  .nav-links a:hover,
  .nav-links a:active {
    background-color: var(--color-light-bg);
    color: var(--color-primary);
  }

  .nav-links a.active {
    background: var(--color-primary);
    color: var(--color-white);
    border-radius: 0;
  }

  .hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
  }

  .hamburger.active span:nth-child(2) {
    opacity: 0;
  }

  .hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
  }

  /* Decoraciones — reducir en mobile */
  .decoration-circle {
    display: none;
  }

  .decoration-dots {
    width: 60px;
    height: 60px;
    opacity: 0.1;
  }

  .decoration-bar {
    width: 60px;
    opacity: 0.15;
  }

  .section-diagonal-bars {
    opacity: 0.1;
  }

  .section-diagonal-bars .diagonal-bar:nth-child(1) {
    width: 40px;
  }

  .section-diagonal-bars .diagonal-bar:nth-child(2) {
    width: 30px;
  }

  .section-diagonal-bars .diagonal-bar:nth-child(3) {
    display: none;
  }

  .btn {
    padding: 12px 30px;
    font-size: 1rem;
  }

  .section-title {
    font-size: 1.8rem;
  }

  .footer-content {
    grid-template-columns: 1fr;
    gap: 24px;
    text-align: center;
    justify-items: center;
  }

  .footer-brand,
  .footer-links,
  .footer-contact,
  .footer-demo {
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .footer-links ul,
  .footer-demo ul {
    padding: 0;
  }

  footer {
    padding: 40px 0 20px;
  }

  .whatsapp-float {
    width: 52px;
    height: 52px;
    bottom: 18px;
    right: 18px;
  }
}