/* 0. MAINTENANCE OVERLAY - FULLSCREEN BLOCKER */
body[data-maintenance-state="locked"],
body[data-maintenance-state="checking"] {
  overflow: hidden;
}

body[data-maintenance-state="locked"] > *:not(#maintenance-overlay):not(script),
body[data-maintenance-state="checking"] > *:not(#maintenance-overlay):not(script) {
  visibility: hidden !important;
  pointer-events: none !important;
}

body[data-maintenance-state="released"] > *:not(#maintenance-overlay):not(script) {
  visibility: visible;
  pointer-events: auto;
}

body[data-maintenance-state="released"] #maintenance-overlay {
  display: none !important;
}

#maintenance-overlay {
  position: fixed;
  inset: 0;
  display: none;
  justify-content: center;
  align-items: center;
  background: radial-gradient(circle at top, rgba(20, 83, 45, 0.85), rgba(9, 13, 16, 0.97));
  z-index: 9999;
  padding: 2rem;
  backdrop-filter: blur(18px) saturate(180%);
  transition: opacity 0.4s ease;
}

body[data-maintenance-state="locked"] #maintenance-overlay,
body[data-maintenance-state="checking"] #maintenance-overlay {
  display: flex;
}

#maintenance-overlay::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    radial-gradient(ellipse at 20% 20%, rgba(61, 168, 138, 0.15) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 80%, rgba(94, 246, 202, 0.1) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 50%, rgba(30, 41, 59, 0.5) 0%, transparent 70%);
  pointer-events: none;
}

#maintenance-overlay .maintenance-content {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 520px;
  padding: 48px 40px;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 32px;
  border: 1px solid rgba(94, 246, 202, 0.15);
  box-shadow: 
    0 25px 50px -12px rgba(0, 0, 0, 0.5),
    0 0 80px rgba(61, 168, 138, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  animation: maintenanceSlideIn 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes maintenanceSlideIn {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.maintenance-icon {
  font-size: 4.5rem;
  margin-bottom: 24px;
  display: inline-block;
  animation: iconPulse 2s ease-in-out infinite;
}

@keyframes iconPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

#maintenance-overlay .maintenance-content h2 {
  color: #fff;
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  margin-bottom: 16px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

#maintenance-overlay .maintenance-content p {
  color: rgba(255, 255, 255, 0.75);
  font-size: 1.05rem;
  line-height: 1.7;
  margin-bottom: 32px;
}

#maintenance-overlay .badge-set {
  justify-content: center;
  margin-bottom: 32px;
}

#maintenance-overlay .badge.primary {
  background: rgba(61, 168, 138, 0.2);
  color: #5ef6ca;
  border: 1px solid rgba(94, 246, 202, 0.25);
  padding: 10px 20px;
  font-size: 0.9rem;
  letter-spacing: 0.05em;
}

#maintenance-overlay .maintenance-admin-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 28px;
  background: linear-gradient(135deg, #3da88a 0%, #2d8b70 100%);
  color: white;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  border-radius: 14px;
  border: 1px solid rgba(94, 246, 202, 0.3);
  box-shadow: 
    0 10px 30px -5px rgba(61, 168, 138, 0.4),
    0 0 0 1px rgba(255, 255, 255, 0.05) inset;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  margin-top: 8px;
}

#maintenance-overlay .maintenance-admin-btn:hover {
  transform: translateY(-3px);
  box-shadow: 
    0 15px 40px -5px rgba(61, 168, 138, 0.5),
    0 0 0 1px rgba(255, 255, 255, 0.1) inset;
  background: linear-gradient(135deg, #4ab899 0%, #3da88a 100%);
}

#maintenance-overlay .maintenance-admin-btn svg {
  width: 18px;
  height: 18px;
}

#maintenance-overlay[data-state="checking"] .maintenance-admin-btn,
#maintenance-overlay[data-state="checking"] .badge-set {
  display: none;
}

#maintenance-overlay[data-state="checking"] .maintenance-content {
  max-width: 360px;
  padding: 40px 32px;
}

#maintenance-overlay[data-state="checking"] .maintenance-icon {
  font-size: 3.2rem;
  animation: spin 1.4s linear infinite;
}

#maintenance-overlay[data-state="checking"] h2 {
  font-size: 1.4rem;
}

#maintenance-overlay[data-state="checking"] p {
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.6);
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* 1. SISTEMA DE COLORES Y VARIABLES PREMIUM */
:root {
  color-scheme: light;
  --bg: #f8fafc;
  --surface: rgba(255, 255, 255, 0.9);
  --text: #0f172a;
  --muted: #64748b;
  --primary: #3da88a;
  --primary-dark: #1b7f63;
  --accent: #5ef6ca;
  --border: rgba(15, 23, 42, 0.06);
  --header-bg: rgba(255, 255, 255, 0.72);
  --hero-gradient: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f3d38 100%);
  --transition-premium: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
  --shadow-lux: 0 20px 40px -12px rgba(0, 0, 0, 0.08);
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #020617;
  --surface: rgba(15, 23, 42, 0.9);
  --text: #f1f5f9;
  --muted: #94a3b8;
  --border: rgba(255, 255, 255, 0.06);
  --header-bg: rgba(2, 6, 23, 0.75);
  --shadow-lux: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

body.static-page, body.landing-page {
  font-family: 'Space Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  transition: background-color 0.5s ease, color 0.5s ease;
}

/* 2. HEADER Y NAVEGACIÓN LUXURY */
.app-header {
  width: clamp(300px, 94vw, 1140px);
  margin: 20px auto 0;
  padding: 10px 24px;
  border-radius: 20px;
  background: var(--header-bg);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-lux);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  position: sticky;
  top: 20px;
  z-index: 1000;
  transition: var(--transition-premium);
  animation: slideDown 0.8s cubic-bezier(0.23, 1, 0.32, 1) forwards;
}

.app-header.scroll-up {
  margin-top: 15px;
  transform: scale(0.98);
  background: var(--surface);
}

.app-header.scroll-down {
  transform: translateY(-120%) scale(0.95);
  opacity: 0;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text);
  font-weight: 800;
  font-size: 1.3rem;
  transition: transform 0.3s ease;
}

.logo img {
  width: 40px;
  height: 40px;
  filter: drop-shadow(0 4px 12px rgba(61, 168, 138, 0.3));
  transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.logo:hover img {
  transform: rotate(12deg) scale(1.1);
}

nav {
  display: flex;
  gap: 24px;
  align-items: center;
}

nav a:not(.btn-admin) {
  text-decoration: none;
  color: var(--text);
  font-weight: 600;
  font-size: 0.9rem;
  opacity: 0.7;
  transition: var(--transition-premium);
  padding: 8px 4px;
  position: relative;
}

nav a:not(.btn-admin):hover, 
nav a.active {
  opacity: 1;
  color: var(--primary);
}

nav a:not(.btn-admin)::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--primary);
  transition: var(--transition-premium);
  border-radius: 2px;
}

nav a:not(.btn-admin):hover::after,
nav a.active::after {
  width: 100%;
}

/* 3. CONTROLES (IDIOMA Y TEMA) */
.header-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 10px;
  background: rgba(0, 0, 0, 0.03);
  border-radius: 14px;
  border: 1px solid var(--border);
  margin: 0 10px;
}

[data-theme="dark"] .header-controls {
  background: rgba(255, 255, 255, 0.03);
}

.lang-switch {
  display: flex;
  gap: 2px;
}

.lang-btn {
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 800;
  padding: 6px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: var(--transition-premium);
}

.lang-btn.active {
  background: var(--primary);
  color: white;
  box-shadow: 0 4px 12px rgba(61, 168, 138, 0.3);
}

.theme-toggle {
  background: transparent;
  border: none;
  color: var(--text);
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-premium);
}

.theme-toggle:hover {
  transform: scale(1.15) rotate(15deg);
  color: var(--primary);
}

.btn-admin {
  background: linear-gradient(135deg, #3da88a, #1b7f63);
  color: white !important;
  padding: 10px 20px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.85rem;
  text-decoration: none;
  box-shadow: 0 10px 20px -5px rgba(61, 168, 138, 0.4);
  transition: var(--transition-premium);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-admin:hover {
  transform: translateY(-3px);
  box-shadow: 0 15px 30px -5px rgba(61, 168, 138, 0.5);
  filter: brightness(1.1);
}

.hero {
  width: clamp(280px, 95vw, 1100px);
  margin: 60px auto 30px;
  padding: 72px 7vw 96px;
  border-radius: 32px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 50px 90px rgba(9, 25, 27, 0.45);
  position: relative;
  overflow: hidden;
  background: var(--hero-gradient);
  color: white;
}

/* HERO LANDING - FULLWIDTH CON EFECTO SCROLL */
.hero--landing {
  width: 100%;
  margin: 0;
  padding: 120px 7vw 100px;
  border-radius: 0 0 48px 48px;
  border: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 50px 100px rgba(9, 25, 27, 0.5);
  position: relative;
  overflow: hidden;
  background: var(--hero-gradient);
  color: white;
  transform-origin: top center;
  transition: transform 0.1s ease-out, border-radius 0.3s ease;
}

.hero--landing.scrolled {
  border-radius: 0 0 32px 32px;
}

.hero--landing::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    radial-gradient(ellipse 80% 50% at 20% 40%, rgba(61, 168, 138, 0.15) 0%, transparent 50%),
    radial-gradient(ellipse 60% 40% at 80% 60%, rgba(94, 246, 202, 0.1) 0%, transparent 50%);
  pointer-events: none;
  z-index: 1;
}

.hero--landing .hero-content {
  position: relative;
  z-index: 2;
  max-width: 720px;
}

.hero--landing .hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 999px;
  background: rgba(61, 168, 138, 0.2);
  border: 1px solid rgba(94, 246, 202, 0.2);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 24px;
  color: #5ef6ca;
}

.hero--landing h1 {
  font-size: clamp(2.5rem, 6vw, 4rem);
  line-height: 1.05;
  margin-bottom: 24px;
  font-weight: 700;
  font-style: italic;
}

.hero--landing .hero-subtitle {
  color: rgba(255, 255, 255, 0.75);
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  line-height: 1.7;
  max-width: 600px;
  margin-bottom: 36px;
}

.hero--landing .hero-ctas {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 48px;
}

.hero--landing .hero-stats {
  display: flex;
  gap: 32px;
  flex-wrap: wrap;
}

.hero--landing .hero-stat {
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(10px);
  padding: 20px 32px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  min-width: 140px;
}

.hero--landing .hero-stat span {
  font-size: 2rem;
  font-weight: 700;
  color: #5ef6ca;
  display: block;
  margin-bottom: 4px;
}

.hero--landing .hero-stat p {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.7);
  margin: 0;
}

.hero::before,
.hero::after {
  content: '';
  position: absolute;
  width: 140%;
  height: 140%;
  top: -55%;
  left: -20%;
  transform: rotate(12deg);
  animation: pulse 14s infinite alternate;
}

.hero::before {
  background: radial-gradient(circle, var(--hero-glow-primary), transparent 65%);
}

.hero::after {
  background: radial-gradient(circle, var(--hero-glow-secondary), transparent 60%);
  top: auto;
  bottom: -75%;
  left: auto;
  right: -10%;
  animation-duration: 18s;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 720px;
  animation: float 14s ease-in-out infinite;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.88rem;
  margin-bottom: 18px;
}

.hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.5rem);
  line-height: 1.1;
  margin-bottom: 18px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 14px;
}

.hero p {
  color: rgba(255, 255, 255, 0.82);
  font-size: clamp(1rem, 2vw, 1.2rem);
  line-height: 1.6;
  max-width: 680px;
}

.page-grid {
  width: clamp(280px, 95vw, 1200px);
  margin: 40px auto 120px;
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 32px;
}

.page-grid--single {
  grid-template-columns: 1fr;
}

.toc {
  position: sticky;
  top: 120px;
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.92);
  border-radius: 24px;
  padding: 26px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 22px 38px rgba(15, 23, 42, 0.1);
  backdrop-filter: blur(20px);
  animation: fadeInUp 0.5s ease both;
}

.toc h3 {
  font-size: 0.92rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin-bottom: 14px;
}

.toc ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toc a {
  text-decoration: none;
  color: var(--text);
  font-weight: 500;
  font-size: 0.93rem;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 4px;
  border-left: 2px solid transparent;
  transition: all 0.25s ease;
}

.toc a span {
  color: var(--muted);
  font-size: 0.85rem;
  width: 28px;
}

.toc a:hover,
.toc a.active {
  color: var(--primary-dark);
  border-left-color: var(--primary);
  padding-left: 12px;
}

.document {
  background: var(--surface);
  border-radius: 32px;
  padding: clamp(28px, 5vw, 54px);
  border: 1px solid rgba(15, 23, 42, 0.04);
  box-shadow: 0 48px 80px rgba(15, 23, 42, 0.12);
  position: relative;
  overflow: hidden;
}

.document::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(140deg, rgba(93, 246, 202, 0.08), transparent);
}

.document--wide {
  width: clamp(280px, 95vw, 1100px);
  margin: 0 auto 120px;
}

.section-card {
  padding: clamp(22px, 4vw, 34px);
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(15, 23, 42, 0.06);
  margin-bottom: 26px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 28px 55px rgba(15, 23, 42, 0.08);
}

.section-card[data-variant="notice"] {
  background: linear-gradient(140deg, #101827, #0c1922);
  color: white;
  border: 1px solid rgba(94, 246, 202, 0.35);
}

.section-card[data-animate] {
  opacity: 0;
  transform: translateY(35px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.section-card.visible {
  opacity: 1;
  transform: translateY(0);
}

.section-card h2 {
  font-size: 1.45rem;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.section-card h3 {
  font-size: 1.1rem;
  margin: 20px 0 10px;
}

.section-card p {
  color: var(--muted);
  line-height: 1.7;
  margin-bottom: 14px;
  text-align: justify;
}

.section-card[data-variant="notice"] p {
  color: rgba(255, 255, 255, 0.82);
}

.section-card ul,
.section-card ol {
  margin: 14px 0 14px 22px;
  color: var(--muted);
  line-height: 1.65;
}

.badge-set {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.badge {
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  background: rgba(61, 168, 138, 0.12);
  color: var(--primary-dark);
}

.badge.gdpr { background: rgba(139, 92, 246, 0.15); color: #6d28d9; }
.badge.lgpd { background: rgba(34, 197, 94, 0.15); color: #047857; }
.badge.ccpa { background: rgba(59, 130, 246, 0.15); color: #1d4ed8; }

.alert-block {
  border-radius: 18px;
  padding: 18px 20px;
  margin: 20px 0;
  font-size: 0.95rem;
  line-height: 1.55;
  font-weight: 500;
  border: 1px dashed rgba(15, 23, 42, 0.12);
  color: var(--text);
  background: rgba(61, 168, 138, 0.08);
}

.alert-block.warning {
  background: rgba(250, 204, 21, 0.18);
  border-color: rgba(133, 77, 14, 0.4);
  color: #854d0e;
}

.alert-block.info {
  background: rgba(59, 130, 246, 0.15);
  border-color: rgba(29, 78, 216, 0.35);
  color: #1d4ed8;
}

.alert-block.danger {
  background: rgba(248, 113, 113, 0.15);
  border-color: rgba(185, 28, 28, 0.35);
  color: #7f1d1d;
}

.table-wrapper {
  overflow-x: auto;
  margin: 18px 0;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.data-table th,
.data-table td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.data-table th {
  color: var(--primary-dark);
  font-weight: 600;
  background: rgba(61, 168, 138, 0.08);
}

.data-table td {
  color: var(--muted);
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}

.info-card {
  border-radius: 20px;
  padding: 24px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  text-decoration: none;
  color: inherit;
}

.info-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 25px 55px rgba(15, 23, 42, 0.16);
}

.info-card h3 {
  font-size: 1.15rem;
  margin-bottom: 10px;
}

.info-card p {
  color: var(--muted);
  line-height: 1.6;
}

.cta-strip {
  margin-top: 30px;
  padding: 24px;
  border-radius: 24px;
  background: linear-gradient(120deg, #f6fffa, #ecfff8);
  border: 1px solid rgba(61, 168, 138, 0.18);
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
}

.link-button {
  text-decoration: none;
  padding: 10px 20px;
  border-radius: 999px;
  font-weight: 600;
  border: 1px solid rgba(61, 168, 138, 0.4);
  color: var(--primary-dark);
  transition: all 0.2s ease;
}

.link-button:hover {
  background: var(--primary-dark);
  color: white;
  box-shadow: 0 20px 30px rgba(61, 168, 138, 0.35);
}

.footer {
  background: linear-gradient(160deg, #050a0f, #0d1b1f);
  color: white;
  padding: 80px 20px 36px;
}

.footer-content {
  width: clamp(280px, 95vw, 1100px);
  margin: 0 auto;
  text-align: center;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  justify-content: center;
  margin: 26px 0;
}

.footer-links a {
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  font-weight: 500;
}

.footer-links a:hover {
  color: white;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  margin-top: 24px;
  padding-top: 18px;
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.9rem;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-30px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
  from { transform: scale(1) rotate(12deg); opacity: 0.65; }
  to { transform: scale(1.2) rotate(20deg); opacity: 1; }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-14px); }
}

@media (max-width: 1024px) {
  .page-grid {
    grid-template-columns: 1fr;
  }

  .toc {
    position: static;
    width: 100%;
  }
}

@media (max-width: 720px) {
  .app-header {
    flex-direction: column;
    gap: 14px;
  }

  nav {
    justify-content: center;
  }

  .section-card,
  .info-card {
    padding: 22px;
  }
}







