/* ==========================================================================
   NORTE LEGAL — Caso de éxito | PeakSites
   Hoja de estilos única (Header + Footer + Contenido)
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }

html, body { max-width: 100%; overflow-x: clip; }

/* ===== VARIABLES ===== */
:root {
  --primary: #0a0f2c;
  --accent: #00d4ff;
  --accent2: #0099ff;
  --bg-light: #f8fafd;
  --bg-dark: #0a0f2c;
  --text-light: #1e2937;
  --text-dark: #f1f5f9;
  --text-soft-light: #64748b;
  --text-soft-dark: #94a3b8;
  --border-light: #e2e8f0;
  --border-dark: rgba(255, 255, 255, 0.12);
  --gold: #d4af37;

  /* Paleta del caso de estudio */
  --bg: #f7f6f2;
  --surface: #ffffff;
  --fg: #0b1220;
  --muted: #5b6472;
  --border: #e6e8ec;
  --text-p: #3f4656;
  --green: #0c2e26;
  --green-2: #0f3d30;
  --radius: 14px;
  --radius-lg: 20px;
  --shadow-sm: 0 4px 14px rgba(15, 23, 42, .06);
  --shadow-md: 0 12px 40px rgba(15, 23, 42, .1);
}

body.dark {
  --bg: #0a0f1c;
  --surface: #121826;
  --fg: #f8f9fa;
  --muted: #a0a9b8;
  --border: #232b3d;
  --accent: #6d6eff;
  --text-p: #cbd5e0;
  --shadow-sm: 0 4px 14px rgba(0,0,0,.35);
  --shadow-md: 0 12px 40px rgba(0,0,0,.5);
}

/* ===== BASE ===== */
body {
  font-family: "Inter", sans-serif;
  background: var(--bg);
  color: var(--fg);
  line-height: 1.7;
  margin: 0;
  padding: 0;
  transition: background .3s, color .3s;
}

.container { width: 90%; max-width: 1100px; margin: auto; }
section { padding: 80px 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
img { max-width: 100%; }
a { font-family: inherit; }

/* ==========================================================================
   HEADER / NAV
   ========================================================================== */
.header {
  position: sticky;
  top: 0;
  z-index: 9999;
  background: rgba(255, 255, 255, 0.95);
  padding: 15px 0;
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-light);
}

body.dark .header {
  background: rgba(10, 15, 44, 0.95);
  border-bottom: 1px solid var(--border-dark);
}

.nav { display: flex; justify-content: space-between; align-items: center; width: 100%; gap: 15px; }
nav { display: flex; align-items: center; gap: 15px; flex: 1; justify-content: flex-end; }
.desktop-nav { flex: 1; display: flex; gap: 10px; justify-content: flex-end; }
.nav-right { display: flex; align-items: center; gap: 15px; }

.logo { height: 28px; width: auto; flex-shrink: 0; transition: transform .3s ease; }
.logo:hover { transform: scale(1.05); }

.brand { display: flex; align-items: center; gap: 5px; text-decoration: none; color: inherit; }
.brand-name { font-weight: 550; font-size: 16px; letter-spacing: 0; line-height: 1; color: inherit; }

body.dark .brand-name {
  background: linear-gradient(90deg, #ffffff, #a0b8ff);
  background-clip: text; -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}

.nav-links a { text-decoration: none; color: inherit; font-weight: 500; }

.nav-link {
  text-decoration: none; color: inherit; font-weight: 500; padding: 12px 14px !important;
  border-radius: 8px; transition: background .25s ease; display: inline-flex;
  align-items: center; gap: 4px; height: 46px; line-height: 1;
}
.nav-link:hover { background: rgba(0, 212, 255, 0.08); }
.chevron { font-size: .68em; transition: transform .3s ease; position: relative; top: -1px; }

.desktop-nav > a {
  padding: 12px 14px; border-radius: 8px; transition: background .25s ease;
  display: inline-flex; align-items: center; height: 46px;
}
.desktop-nav > a:hover { background: rgba(0, 212, 255, 0.08); }

/* Mega menú */
.nav-item { position: relative; display: inline-block; }
.mega-menu {
  position: absolute; top: 100%; left: 50%; transform: translateX(-50%);
  padding-top: 15px; opacity: 0; visibility: hidden; transition: all .3s ease;
  z-index: 10000; pointer-events: none; width: 100vw;
}
.nav-item:hover .mega-menu { opacity: 1; visibility: visible; pointer-events: auto; }

.mega-menu-content {
  background: white; border-radius: 22px; box-shadow: 0 30px 80px -20px rgba(0,0,0,.22);
  border: 1px solid #e2e8f0; margin: 0 auto; max-width: 1180px; width: 95%; padding: 50px 48px;
}
body.dark .mega-menu-content { background: #0f1629; border-color: rgba(255,255,255,.09); }

.mega-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 52px; }
.mega-column h4 {
  font-size: 14.8px; font-weight: 700; color: #00d4ff; margin-bottom: 28px;
  letter-spacing: .5px; text-transform: uppercase;
}
.mega-column a { display: block; padding: 2px 6px; color: var(--text-light); text-decoration: none; font-size: 15.4px; line-height: 1.4; }
body.dark .mega-column a { color: var(--text-dark); }
.mega-column a:hover { color: #00d4ff; padding-left: 12px; }

@media (max-width: 991px) { .mega-menu { display: none !important; } }

/* Theme toggle */
.theme-toggle {
  height: 32px; width: 32px; border: 1px solid var(--border-light); border-radius: 6px;
  background: none; cursor: pointer; transition: .3s; color: var(--primary);
}
body.dark .theme-toggle { border: 1px solid rgba(255,255,255,.2); color: #fff; }
.theme-toggle:hover { background: rgba(0, 212, 255, .08); }

/* Selector de idioma */
.lang-switch { position: relative; display: inline-block; margin-left: 12px; z-index: 100; }
.lang-current {
  display: flex !important; align-items: center; gap: 8px; padding: 8px 16px; border-radius: 10px;
  background: #0f1629; color: #fff; font-weight: 600; font-size: 15px; cursor: pointer;
  white-space: nowrap; border: 2px solid transparent !important;
  box-shadow: 0 4px 12px rgba(0,0,0,.3) !important; transition: all .2s ease !important;
}
.lang-current:hover {
  background: #1a2338 !important; border: 2px solid #00d4ff !important;
  box-shadow: 0 0 0 4px rgba(0,212,255,.25), 0 6px 20px rgba(0,212,255,.45) !important;
}
.flag-wrapper img { width: 20px; height: 14px; object-fit: cover; border-radius: 2px; display: block; }
.lang-menu {
  position: absolute; top: 100%; right: 0; background: #1f252f; border: 1px solid #444;
  border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.3); display: none;
  min-width: 180px; padding: 8px 0; z-index: 9999;
}
.lang-switch:hover .lang-menu { display: block; }
.lang-option { display: flex; align-items: center; gap: 10px; padding: 10px 16px; color: #fff; text-decoration: none; font-size: 14px; }
.lang-option:hover { background: rgba(255,255,255,.06); }

body:not(.dark) .header .lang-current { background: #fff !important; color: #0a0f2c !important; box-shadow: 0 8px 25px rgba(10,15,44,.08) !important; }
body:not(.dark) .lang-current:hover, body:not(.dark) .lang-switch:hover .lang-current { border: 2px solid #00d4ff !important; box-shadow: 0 0 0 4px rgba(0,212,255,.2), 0 10px 30px rgba(0,212,255,.35) !important; }
body:not(.dark) .lang-menu { background: #fff !important; border: 1px solid #e2e8f0 !important; box-shadow: 0 15px 40px rgba(10,15,44,.1) !important; }
body:not(.dark) .lang-option { color: #0a0f2c; }

/* Menú móvil */
.mobile-menu-btn { display: none; background: none; border: none; font-size: 34px; color: var(--primary); cursor: pointer; padding: 5px 10px; }
body.dark .mobile-menu-btn { color: #fff; }
.mobile-theme-btn { margin-left: 4px; }

.mobile-menu {
  position: fixed; inset: 0; width: 100vw; height: 100vh; background: rgba(0,0,0,.65);
  backdrop-filter: blur(4px); z-index: 9999999; display: none; justify-content: flex-end;
}
.mobile-menu.active { display: flex; }
.mobile-menu-links {
  position: fixed !important; top: 0 !important; right: 0 !important; width: 82vw !important;
  max-width: 300px !important; height: 100vh !important; padding: 80px 25px 40px 30px !important;
  background: #0a0f2c !important; z-index: 9999999999 !important; overflow-y: auto;
}
.close-menu-btn {
  position: fixed; top: 18px; right: 18px; font-size: 32px; color: #fff;
  background: rgba(0,0,0,.4); border: none; border-radius: 8px; padding: 6px 10px;
  cursor: pointer; z-index: 9999999999 !important;
}
.mobile-link { display: block; color: #fff; font-size: 1.1rem; padding: 16px 0; text-align: left; text-decoration: none; border-bottom: 1px solid rgba(255,255,255,.15); }

.mobile-lang-container { margin-top: 20px; }
.mobile-lang-switch .lang-current { background: #131a2e; color: #fff; }
.mobile-lang-switch .lang-menu { position: static; display: block; background: transparent; border: 0; box-shadow: none; padding: 8px 0 0; min-width: unset; }
.mobile-lang-switch .lang-option { color: #cbd5e0; padding: 10px 8px; }

@media (max-width: 991px) {
  .desktop-nav, .nav-right, .header .lang-switch { display: none !important; }
  .mobile-menu-btn { display: block; }
}
@media (min-width: 992px) {
  .mobile-menu, .mobile-menu-btn, .mobile-theme-btn { display: none !important; }
}

/* ==========================================================================
   CASE STUDY — Contenido principal
   ========================================================================== */
.breadcrumb { padding: 24px 0 8px; font-size: .85rem; color: var(--muted); display: flex; gap: 8px; flex-wrap: wrap; }
.breadcrumb a { color: var(--muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb [aria-current="page"] { color: var(--fg); }

.case-hero { max-width: 900px; margin: 0 auto; padding: 60px 20px 0; text-align: center; }
.case-hero h1 { margin-bottom: 20px; line-height: 1.2; font-size: 2.4rem; letter-spacing: -.02em; }
.case-hero .lead { max-width: 700px; margin: 0 auto; color: var(--muted); font-size: 1.1rem; }

.services-banner {
  display: flex; justify-content: center; gap: 40px; padding: 24px;
  background: var(--surface) !important; border-top: 1px solid var(--border) !important;
  border-bottom: 1px solid var(--border) !important; margin: 40px 0; color: var(--fg) !important;
}
.service-item { font-weight: 600; display: flex; gap: 10px; align-items: center; color: var(--fg) !important; }

.case-grid { display: block; max-width: 900px; margin: 0 auto; padding: 32px 20px; }
.case-main { width: 100%; }
.case-main > section { margin: 0 0 64px; }
.case-main h2 { font-size: 1.75rem; letter-spacing: -.01em; margin: 0 0 20px; font-weight: 600; }
.case-main h3 { font-size: 1.05rem; margin: 0 0 8px; font-weight: 600; }
.case-main p { margin: 0 0 16px; color: var(--text-p); }

.link-arrow { color: var(--accent); font-weight: 600; font-size: .95rem; display: inline-flex; align-items: center; gap: 8px; margin-top: 6px; text-decoration: none; }
.link-arrow:hover { text-decoration: underline; }

/* Figuras */
.case-figure { margin: 28px 0 8px; border-radius: var(--radius-lg); overflow: hidden; position: relative; box-shadow: var(--shadow-md); }
.case-figure img { width: 100%; height: auto; display: block; }
.case-figure.dark { background: linear-gradient(135deg, #0a1226, #12244a); min-height: 280px; }
.case-figure.dark img { opacity: .95; }
body.dark .case-figure.dark { background: linear-gradient(135deg, #0b1220, #182440); }

.case-figure.green {
  background: linear-gradient(135deg, var(--green), var(--green-2));
  padding: 64px 24px; min-height: 420px; display: flex; align-items: center; justify-content: center; position: relative;
}

/* Grid de features */
.feature-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; margin: 28px 0 8px; }
.feature { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow-sm); }
.feature .check { width: 32px; height: 32px; border-radius: 8px; background: #eee9ff; color: #5b4bff; display: flex; align-items: center; justify-content: center; font-weight: 700; margin-bottom: 14px; }
body.dark .feature .check { background: rgba(109,110,255,.18); color: #a5a6ff; }
.feature p { color: var(--muted); font-size: .95rem; margin: 0; }

/* Mock formulario */
.mock-form { width: min(420px, 100%); background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 28px; box-shadow: 0 20px 60px rgba(0,0,0,.18); display: flex; flex-direction: column; }
.mock-form__title { font-size: .72rem; letter-spacing: .14em; color: var(--muted); margin: 0 0 18px; font-weight: 600; text-transform: uppercase; }
.mock-field { border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; margin-bottom: 12px; display: flex; flex-direction: column; }
.mock-field label { font-size: .7rem; color: var(--muted); margin-bottom: 2px; }
.mock-field input { background: transparent; border: none; color: var(--fg); font-size: .95rem; padding: 0; outline: none; width: 100%; font-family: inherit; }
.mock-cta { background: var(--accent); color: #fff; text-align: center; padding: 12px; border-radius: 8px; font-weight: 600; font-size: .95rem; border: none; cursor: pointer; transition: opacity .2s; }
.mock-cta:hover { opacity: .9; }

/* Resultado */
.result-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 36px; box-shadow: var(--shadow-sm); }
.result-card hr { border: 0; border-top: 1px solid var(--border); margin: 24px 0 16px; }

/* Acordeón — Estrategia */
.strategy-section { margin: 64px 0; }
.section-intro { margin-bottom: 24px; color: var(--muted); }

.accordion-item { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; margin-bottom: 12px; padding: 16px; cursor: pointer; }
.accordion-item summary { font-weight: 600; outline: none; list-style: none; }
.accordion-item summary::-webkit-details-marker { display: none; }
.accordion-item summary::after { content: '▾'; float: right; color: var(--gold); }
.accordion-item[open] summary::after { content: '▴'; }
.accordion-item p { margin: 14px 0 0; }

/* Tarjetas técnicas */
.tech-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 32px; }
.card { background: var(--surface); padding: 30px; border-radius: 16px; border: 1px solid var(--border); transition: transform .2s ease, border-color .2s ease; }
.card:hover { border-color: var(--accent); transform: translateY(-4px); }
.card h4 { color: var(--fg); margin-bottom: 12px; font-size: 1.1rem; }
.card p { color: var(--muted); font-size: .95rem; line-height: 1.6; margin: 0; }

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

/* Sección CTA */
.cta-section { padding: 100px 20px; background: var(--surface); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); text-align: center; }
.cta-container { max-width: 700px; margin: 0 auto; }
.cta-title { font-size: 2.5rem; line-height: 1.1; margin-bottom: 20px; letter-spacing: -.03em; color: var(--fg); }
.cta-subtitle { font-size: 1.15rem; color: var(--muted); margin-bottom: 40px; line-height: 1.6; }
.cta-button { display: inline-flex; align-items: center; background: var(--accent); color: #fff; padding: 18px 36px; border-radius: 12px; text-decoration: none; font-weight: 600; font-size: 1.05rem; transition: transform .2s ease, box-shadow .2s ease; }
.cta-button:hover { transform: translateY(-2px); box-shadow: 0 10px 20px rgba(0,212,255,.25); }

@media (max-width: 980px) {
  .feature-grid { grid-template-columns: 1fr; }
  .case-hero h1 { font-size: 2rem; }
}
@media (max-width: 640px) {
  .cta-section { padding: 60px 20px; }
  .cta-title { font-size: 1.85rem; }
  .cta-subtitle { font-size: 1rem; margin-bottom: 30px; }
  .cta-button { width: 100%; justify-content: center; }
  .services-banner { flex-direction: column; align-items: center; gap: 15px; padding: 20px; }
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
.footer-pro { background: #0a1020; color: #c9d0dd; margin-top: 80px; border-top: 1px solid #131a2e; padding: 64px 0 0; }
.footer-pro a { color: #c9d0dd; text-decoration: none; transition: color .15s ease; }
.footer-pro a:hover { color: #fff; }

.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr 1fr; gap: 32px; padding-bottom: 40px; }
.footer-grid h4 { color: #fff; font-size: .85rem; letter-spacing: .08em; text-transform: uppercase; margin: 0 0 18px; font-weight: 600; }
.footer-grid > div { display: flex; flex-direction: column; gap: 10px; font-size: .92rem; }

.footer-bottom { border-top: 1px solid #131a2e; padding: 20px 0; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; font-size: .82rem; color: #7a8194; }

@media (max-width: 980px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 640px) { .footer-grid { grid-template-columns: 1fr; } .footer-bottom { flex-direction: column; align-items: flex-start; } }


/* ==========================================================================
   RESULTADO (.result-card)
   ========================================================================== */
.result-card { 
  background: #ffffff !important; 
  color: #0b1220 !important; 
  border: 1px solid var(--border); 
  border-radius: var(--radius-lg); 
  padding: 36px; 
  box-shadow: var(--shadow-sm); 
}

.result-card h2 {
  color: #0b1220 !important;
}

.result-card p { 
  color: #3f4656 !important; 
}

.result-card hr { 
  border: 0; 
  border-top: 1px solid var(--border); 
  margin: 24px 0 16px; 
}

/* El modo oscuro se mantiene exactamente igual sin alteraciones */
body.dark .result-card { 
  background: var(--surface) !important; 
  color: var(--fg) !important; 
  border-color: var(--border) !important; 
}

body.dark .result-card h2,
body.dark .result-card p {
  color: var(--fg) !important;
}