/* ═══════════════════════════════════════════════════════════════
   Rentetrix Help Center — Premium Design System
   Brand Colors: Magenta #E91E8C → Purple #9B59B6 → Cyan #33F0E0
   ═══════════════════════════════════════════════════════════════ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500&display=swap');

/* ── CSS Variables ── */
:root {
   --bg-primary: #0b0f1a;
   --bg-secondary: #111827;
   --bg-card: rgba(17, 24, 39, 0.7);
   --bg-glass: rgba(255, 255, 255, 0.03);
   --bg-glass-hover: rgba(255, 255, 255, 0.06);
   --border-glass: rgba(255, 255, 255, 0.08);
   --border-glass-hover: rgba(51, 240, 224, 0.3);
   --text-primary: #f1f5f9;
   --text-secondary: #94a3b8;
   --text-muted: #64748b;

   /* Brand gradient: magenta → purple → cyan */
   --brand-magenta: #E91E8C;
   --brand-purple: #9B59B6;
   --brand-cyan: #33F0E0;
   --brand-cyan-soft: #33C3F0;

   /* Accent = cyan (primary interactive color) */
   --accent: #33F0E0;
   --accent-hover: #33C3F0;
   --accent-glow: rgba(51, 240, 224, 0.12);
   --accent-glow-strong: rgba(51, 240, 224, 0.25);

   --success: #10b981;
   --danger: #ef4444;
   --info: #3b82f6;
   --radius-sm: 8px;
   --radius-md: 12px;
   --radius-lg: 16px;
   --radius-xl: 24px;
   --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.3);
   --shadow-glow: 0 0 30px rgba(51, 240, 224, 0.06);
   --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
   --font-main: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
   --font-mono: 'JetBrains Mono', monospace;
   --header-height: 64px;
}

/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
   scroll-behavior: smooth;
   -webkit-font-smoothing: antialiased;
   -moz-osx-font-smoothing: grayscale;
}

body {
   font-family: var(--font-main);
   background: var(--bg-primary);
   color: var(--text-primary);
   line-height: 1.7;
   min-height: 100vh;
   overflow-x: hidden;
}

/* Background mesh with brand colors */
body::before {
   content: '';
   position: fixed;
   top: 0; left: 0;
   width: 100%; height: 100%;
   background:
      radial-gradient(ellipse 80% 50% at 20% 40%, rgba(233, 30, 140, 0.03) 0%, transparent 60%),
      radial-gradient(ellipse 60% 40% at 80% 20%, rgba(51, 240, 224, 0.03) 0%, transparent 50%),
      radial-gradient(ellipse 50% 60% at 50% 80%, rgba(155, 89, 182, 0.02) 0%, transparent 50%);
   pointer-events: none;
   z-index: 0;
}

a { color: var(--accent); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--accent-hover); }

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

::selection {
   background: var(--brand-cyan);
   color: var(--bg-primary);
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-secondary); }
::-webkit-scrollbar-thumb { background: var(--text-muted); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* ═══════════════════════════════════════════════════════════════
   HEADER / NAVBAR
   ═══════════════════════════════════════════════════════════════ */
.header {
   position: fixed;
   top: 0; left: 0; right: 0;
   height: var(--header-height);
   background: rgba(11, 15, 26, 0.85);
   backdrop-filter: blur(20px) saturate(1.8);
   -webkit-backdrop-filter: blur(20px) saturate(1.8);
   border-bottom: 1px solid var(--border-glass);
   z-index: 1000;
   display: flex;
   align-items: center;
   padding: 0 24px;
   transition: var(--transition);
}

.header.scrolled {
   background: rgba(11, 15, 26, 0.95);
   box-shadow: 0 2px 20px rgba(0, 0, 0, 0.4);
}

.header__brand {
   display: flex;
   align-items: center;
   gap: 12px;
   font-weight: 800;
   font-size: 1.2rem;
   letter-spacing: -0.02em;
}

.header__brand-logo {
   height: 50px;
   width: auto;
   object-fit: contain;
   filter: brightness(1.1);
   mix-blend-mode: screen;
   clip-path: inset(0 0 30% 0);
   margin-bottom: -15px;
}

.header__brand-text {
   background: linear-gradient(135deg, var(--brand-magenta), var(--brand-cyan));
   -webkit-background-clip: text;
   -webkit-text-fill-color: transparent;
   background-clip: text;
}

.header__nav {
   display: flex;
   align-items: center;
   gap: 16px;
   margin-left: auto;
}

.header__search {
   position: relative;
   margin-right: 8px;
}

.header__search input {
   background: var(--bg-glass);
   border: 1px solid var(--border-glass);
   color: var(--text-primary);
   padding: 8px 16px 8px 36px;
   border-radius: 20px;
   font-family: var(--font-main);
   font-size: 0.85rem;
   width: 220px;
   transition: var(--transition);
   outline: none;
}

.header__search input:focus {
   border-color: var(--accent);
   width: 300px;
   box-shadow: 0 0 0 3px var(--accent-glow);
}

.header__search input::placeholder { color: var(--text-muted); }

.header__search-icon {
   position: absolute;
   left: 12px; top: 50%;
   transform: translateY(-50%);
   color: var(--text-muted);
   font-size: 14px;
   pointer-events: none;
}

/* Language Selector */
.lang-selector {
   display: flex;
   gap: 4px;
   background: var(--bg-glass);
   border: 1px solid var(--border-glass);
   border-radius: 20px;
   padding: 3px;
}

.lang-btn {
   padding: 4px 12px;
   border: none;
   background: transparent;
   color: var(--text-muted);
   font-family: var(--font-main);
   font-size: 0.8rem;
   font-weight: 600;
   border-radius: 16px;
   cursor: pointer;
   transition: var(--transition);
   text-transform: uppercase;
   letter-spacing: 0.05em;
}

.lang-btn:hover { color: var(--text-primary); }

.lang-btn.active {
   background: linear-gradient(135deg, var(--brand-magenta), var(--brand-cyan));
   color: var(--bg-primary);
   box-shadow: 0 2px 8px rgba(51, 240, 224, 0.25);
}

/* ═══════════════════════════════════════════════════════════════
   HERO SECTION
   ═══════════════════════════════════════════════════════════════ */
.hero {
   padding: calc(var(--header-height) + 40px) 24px 40px;
   text-align: center;
   position: relative;
   z-index: 1;
}

.hero__infographic {
   max-width: 800px;
   margin: 0 auto 32px;
   border-radius: var(--radius-xl);
   overflow: hidden;
   box-shadow: var(--shadow-card), var(--shadow-glow);
   border: 1px solid var(--border-glass);
   transition: var(--transition);
   animation: heroFloat 6s ease-in-out infinite;
}

.hero__infographic:hover {
   transform: translateY(-4px);
   box-shadow: var(--shadow-card), 0 0 50px rgba(51, 240, 224, 0.1);
}

.hero__infographic img { display: block; width: 100%; }

@keyframes heroFloat {
   0%, 100% { transform: translateY(0); }
   50% { transform: translateY(-6px); }
}

.hero__title {
   font-size: clamp(1.8rem, 4vw, 2.8rem);
   font-weight: 900;
   letter-spacing: -0.03em;
   margin-bottom: 12px;
   line-height: 1.2;
}

.hero__title span {
   background: linear-gradient(135deg, var(--brand-magenta), var(--brand-purple), var(--brand-cyan));
   -webkit-background-clip: text;
   -webkit-text-fill-color: transparent;
   background-clip: text;
}

.hero__subtitle {
   font-size: clamp(1rem, 2vw, 1.2rem);
   color: var(--text-secondary);
   max-width: 600px;
   margin: 0 auto 32px;
   font-weight: 400;
}

/* ═══════════════════════════════════════════════════════════════
   QUICK STATS BAR
   ═══════════════════════════════════════════════════════════════ */
.quick-stats {
   display: flex;
   justify-content: center;
   gap: 40px;
   padding: 24px;
   margin: 0 auto 20px;
   max-width: 900px;
   flex-wrap: wrap;
}

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

.quick-stat__number {
   font-size: 2rem;
   font-weight: 900;
   background: linear-gradient(135deg, var(--brand-magenta), var(--brand-cyan));
   -webkit-background-clip: text;
   -webkit-text-fill-color: transparent;
   background-clip: text;
   line-height: 1.2;
}

.quick-stat__label {
   font-size: 0.8rem;
   color: var(--text-muted);
   text-transform: uppercase;
   letter-spacing: 0.1em;
   font-weight: 500;
}

/* ═══════════════════════════════════════════════════════════════
   MODULE CARDS GRID
   ═══════════════════════════════════════════════════════════════ */
.modules {
   padding: 20px 24px 60px;
   position: relative;
   z-index: 1;
}

.modules__title {
   text-align: center;
   font-size: 1.1rem;
   font-weight: 600;
   color: var(--text-secondary);
   margin-bottom: 32px;
   text-transform: uppercase;
   letter-spacing: 0.15em;
}

.modules__grid {
   display: grid;
   grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
   gap: 20px;
   max-width: 1200px;
   margin: 0 auto;
}

.module-card {
   background: var(--bg-card);
   border: 1px solid var(--border-glass);
   border-radius: var(--radius-lg);
   padding: 28px 24px;
   cursor: pointer;
   transition: var(--transition);
   position: relative;
   overflow: hidden;
   text-decoration: none;
   color: inherit;
   display: block;
}

.module-card::before {
   content: '';
   position: absolute;
   top: 0; left: 0;
   width: 100%; height: 3px;
   background: linear-gradient(90deg, var(--brand-magenta), var(--brand-purple), var(--brand-cyan));
   opacity: 0;
   transition: var(--transition);
}

.module-card:hover {
   border-color: var(--border-glass-hover);
   transform: translateY(-4px);
   box-shadow: var(--shadow-card), var(--shadow-glow);
   background: var(--bg-glass-hover);
}

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

.module-card__icon {
   width: 48px;
   height: 48px;
   border-radius: var(--radius-md);
   display: flex;
   align-items: center;
   justify-content: center;
   font-size: 24px;
   margin-bottom: 16px;
   background: var(--accent-glow);
   color: var(--accent);
   transition: var(--transition);
}

.module-card:hover .module-card__icon {
   background: var(--accent-glow-strong);
   box-shadow: 0 0 20px var(--accent-glow);
}

.module-card__title {
   font-size: 1.05rem;
   font-weight: 700;
   margin-bottom: 6px;
   color: var(--text-primary);
}

.module-card__desc {
   font-size: 0.875rem;
   color: var(--text-secondary);
   line-height: 1.6;
}

.module-card__badge {
   position: absolute;
   top: 16px; right: 16px;
   padding: 3px 10px;
   border-radius: 12px;
   font-size: 0.7rem;
   font-weight: 600;
   text-transform: uppercase;
   letter-spacing: 0.05em;
}

.module-card__badge--new {
   background: rgba(16, 185, 129, 0.15);
   color: var(--success);
}

.module-card__badge--popular {
   background: rgba(233, 30, 140, 0.12);
   color: var(--brand-magenta);
}

.module-card__arrow {
   position: absolute;
   bottom: 16px; right: 16px;
   color: var(--text-muted);
   font-size: 18px;
   transition: var(--transition);
}

.module-card:hover .module-card__arrow {
   color: var(--accent);
   transform: translateX(4px);
}

/* ═══════════════════════════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════════════════════════ */
.footer {
   text-align: center;
   padding: 40px 24px;
   border-top: 1px solid var(--border-glass);
   color: var(--text-muted);
   font-size: 0.85rem;
   position: relative;
   z-index: 1;
}

.footer__brand {
   font-weight: 700;
   background: linear-gradient(135deg, var(--brand-magenta), var(--brand-cyan));
   -webkit-background-clip: text;
   -webkit-text-fill-color: transparent;
   background-clip: text;
}

/* ═══════════════════════════════════════════════════════════════
   SCROLL REVEAL ANIMATIONS
   ═══════════════════════════════════════════════════════════════ */
.reveal {
   opacity: 0;
   transform: translateY(30px);
   transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.visible {
   opacity: 1;
   transform: translateY(0);
}

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }
.reveal-delay-5 { transition-delay: 0.5s; }
.reveal-delay-6 { transition-delay: 0.6s; }
.reveal-delay-7 { transition-delay: 0.7s; }
.reveal-delay-8 { transition-delay: 0.8s; }

/* ═══════════════════════════════════════════════════════════════
   I18N — Language visibility
   ═══════════════════════════════════════════════════════════════ */
[data-lang] { display: none; }
body.lang-es [data-lang="es"],
body.lang-en [data-lang="en"],
body.lang-fr [data-lang="fr"] { display: initial; }

[data-lang-block] { display: none; }
body.lang-es [data-lang-block="es"],
body.lang-en [data-lang-block="en"],
body.lang-fr [data-lang-block="fr"] { display: block; }

[data-lang-flex] { display: none; }
body.lang-es [data-lang-flex="es"],
body.lang-en [data-lang-flex="en"],
body.lang-fr [data-lang-flex="fr"] { display: flex; }

/* ═══════════════════════════════════════════════════════════════
   MODULE PAGE STYLES (for individual module pages)
   ═══════════════════════════════════════════════════════════════ */
.module-page {
   max-width: 960px;
   margin: 0 auto;
   padding: calc(var(--header-height) + 32px) 24px 60px;
   position: relative;
   z-index: 1;
}

.module-page__breadcrumb {
   display: flex;
   align-items: center;
   gap: 8px;
   font-size: 0.85rem;
   color: var(--text-muted);
   margin-bottom: 24px;
}

.module-page__breadcrumb a { color: var(--accent); }

.module-page h1 {
   font-size: clamp(1.6rem, 3vw, 2.2rem);
   font-weight: 900;
   letter-spacing: -0.02em;
   margin-bottom: 8px;
   background: linear-gradient(135deg, var(--brand-magenta), var(--brand-cyan));
   -webkit-background-clip: text;
   -webkit-text-fill-color: transparent;
   background-clip: text;
}

.module-page h2 {
   font-size: 1.3rem;
   font-weight: 700;
   color: var(--text-primary);
   margin: 32px 0 16px;
   padding-bottom: 8px;
   border-bottom: 1px solid var(--border-glass);
}

.module-page h3 {
   font-size: 1.1rem;
   font-weight: 600;
   color: var(--brand-cyan);
   margin: 24px 0 12px;
}

.module-page p {
   color: var(--text-secondary);
   margin-bottom: 16px;
}

.module-page ul, .module-page ol {
   color: var(--text-secondary);
   padding-left: 24px;
   margin-bottom: 16px;
}

.module-page li { margin-bottom: 6px; }

.module-page img {
   border-radius: var(--radius-md);
   border: 1px solid var(--border-glass);
   margin: 16px 0;
   box-shadow: var(--shadow-card);
   transition: var(--transition);
}

.module-page img:hover {
   transform: scale(1.02);
   box-shadow: var(--shadow-card), var(--shadow-glow);
}

.module-page code {
   background: rgba(51, 240, 224, 0.08);
   color: var(--brand-cyan);
   padding: 2px 6px;
   border-radius: 4px;
   font-family: var(--font-mono);
   font-size: 0.85em;
}

.module-page blockquote {
   border-left: 3px solid var(--brand-cyan);
   padding: 12px 20px;
   margin: 16px 0;
   background: var(--bg-glass);
   border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
   color: var(--text-secondary);
}

.module-page table {
   width: 100%;
   border-collapse: collapse;
   margin: 16px 0;
}

.module-page th {
   text-align: left;
   padding: 10px 14px;
   background: var(--bg-glass);
   color: var(--brand-cyan);
   font-weight: 600;
   font-size: 0.85rem;
   text-transform: uppercase;
   letter-spacing: 0.05em;
   border-bottom: 1px solid var(--border-glass);
}

.module-page td {
   padding: 10px 14px;
   border-bottom: 1px solid var(--border-glass);
   color: var(--text-secondary);
   font-size: 0.9rem;
}

.module-page tr:hover td { background: var(--bg-glass); }

/* Tip/Warning/Note callouts */
.callout {
   padding: 16px 20px;
   border-radius: var(--radius-md);
   margin: 16px 0;
   font-size: 0.9rem;
}

.callout--tip {
   background: rgba(51, 240, 224, 0.06);
   border-left: 3px solid var(--brand-cyan);
   color: var(--text-secondary);
}

.callout--warning {
   background: rgba(233, 30, 140, 0.06);
   border-left: 3px solid var(--brand-magenta);
   color: var(--text-secondary);
}

.callout--note {
   background: rgba(155, 89, 182, 0.06);
   border-left: 3px solid var(--brand-purple);
   color: var(--text-secondary);
}

.callout__title {
   font-weight: 700;
   margin-bottom: 4px;
   color: var(--text-primary);
}

/* ═══════════════════════════════════════════════════════════════
   TABLE OF CONTENTS (TOC)
   ═══════════════════════════════════════════════════════════════ */
.toc {
   background: var(--bg-card);
   border: 1px solid var(--border-glass);
   border-radius: var(--radius-lg);
   padding: 0;
   margin: 24px 0 32px;
   overflow: hidden;
   backdrop-filter: blur(12px);
   position: relative;
}

.toc::before {
   content: '';
   position: absolute;
   top: 0; left: 0;
   width: 100%; height: 3px;
   background: linear-gradient(90deg, var(--brand-magenta), var(--brand-purple), var(--brand-cyan));
}

.toc__toggle {
   display: flex;
   align-items: center;
   justify-content: space-between;
   width: 100%;
   padding: 16px 20px;
   background: transparent;
   border: none;
   color: var(--text-primary);
   font-family: var(--font-main);
   font-size: 0.95rem;
   font-weight: 700;
   cursor: pointer;
   letter-spacing: 0.02em;
   transition: var(--transition);
}

.toc__toggle:hover { background: var(--bg-glass-hover); }

.toc__toggle-icon {
   font-size: 18px;
   color: var(--accent);
   transition: transform 0.3s ease;
}

.toc.toc--open .toc__toggle-icon { transform: rotate(180deg); }

.toc__body {
   max-height: 0;
   overflow: hidden;
   transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.toc.toc--open .toc__body { max-height: 800px; }

.toc__list {
   list-style: none;
   padding: 0 12px 12px;
   margin: 0;
   display: grid;
   grid-template-columns: 1fr 1fr;
   gap: 4px;
}

.toc__item {
   margin: 0;
}

.toc__link {
   display: flex;
   align-items: center;
   gap: 10px;
   padding: 8px 12px;
   border-radius: var(--radius-sm);
   color: var(--text-secondary);
   font-size: 0.85rem;
   font-weight: 500;
   transition: var(--transition);
   text-decoration: none;
   line-height: 1.3;
}

.toc__link:hover {
   background: var(--accent-glow);
   color: var(--accent);
   transform: translateX(4px);
}

.toc__link.active {
   background: var(--accent-glow);
   color: var(--accent);
   font-weight: 600;
   box-shadow: inset 3px 0 0 var(--accent);
}

.toc__number {
   display: inline-flex;
   align-items: center;
   justify-content: center;
   width: 22px;
   height: 22px;
   border-radius: 6px;
   background: var(--bg-glass);
   border: 1px solid var(--border-glass);
   font-size: 0.7rem;
   font-weight: 700;
   color: var(--text-muted);
   flex-shrink: 0;
   transition: var(--transition);
}

.toc__link:hover .toc__number,
.toc__link.active .toc__number {
   background: var(--accent);
   color: var(--bg-primary);
   border-color: var(--accent);
}

.toc__icon {
   font-size: 14px;
   flex-shrink: 0;
   opacity: 0.7;
}

@media (max-width: 768px) {
   .toc__list {
      grid-template-columns: 1fr;
   }
}

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
   .header { padding: 0 16px; }
   .header__search input { width: 150px; }
   .header__search input:focus { width: 200px; }
   .hero { padding-top: calc(var(--header-height) + 24px); }
   .hero__infographic { max-width: 100%; }
   .modules__grid { grid-template-columns: 1fr; gap: 16px; }
   .quick-stats { gap: 24px; }
   .quick-stat__number { font-size: 1.5rem; }
   .module-page { padding-left: 16px; padding-right: 16px; }
}

@media (max-width: 480px) {
   .header__search { display: none; }
   .lang-btn { padding: 4px 8px; font-size: 0.7rem; }
}
