/* ============================================================
   MORA_w — Gestor en IA
   Estilos de la landing (SPA de pantallas).
   Tema oscuro (Inicio + Contacto) conservado; tema claro Apple
   para las pantallas intermedias. Tipografía: SF Pro (nativo en
   Apple) con fallback de sistema.
   ============================================================ */

/* ---------- Variables ---------- */
:root {
  --azul: #0062ff;
  --cyan: #00d2ff;
  --bg: #050505;
  --bg2: #0a0a0e;
  --card: rgba(255, 255, 255, .05);
  --card2: #111318;
  --text: #f8fafc;
  --dim: #94a3b8;
  --ok: #10b981;
  --danger: #ff4b2b;
  --warn: #ffd166;
  --border: rgba(255, 255, 255, .08);
  --ring: rgba(0, 210, 255, .35);
  --grad: linear-gradient(90deg, var(--azul), var(--cyan));
  --font-display: 'Outfit', system-ui, sans-serif;
  --font-body: 'Plus Jakarta Sans', system-ui, sans-serif;
  --font-serif: 'Fraunces', 'Outfit', Georgia, 'Times New Roman', serif;
}

/* Pantallas centrales — fondo oscuro (fotos visibles) con tarjetas de vidrio oscuro */
body[data-theme="light"] {
  --bg: #050505;
  --bg2: #0a0a0e;
  --card: rgba(255, 255, 255, .05);
  --card2: #111318;
  --text: #f8fafc;
  --dim: #94a3b8;
  --border: rgba(255, 255, 255, .08);
  --ring: rgba(0, 210, 255, .35);
  --font-display: 'Outfit', system-ui, sans-serif;
  --font-body: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;
}

/* ---------- Base ---------- */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.6;
  overflow-x: hidden;
  transition: background .4s, color .4s;
}
h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.15; letter-spacing: -.02em; }
a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- Escena visual (solo pantallas oscuras) ---------- */
#mora-scene { transition: opacity .5s; }
body[data-theme="light"] #mora-scene { opacity: 0; pointer-events: none; }
#particles { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
#mora-foto {
  position: fixed; top: 1cm; right: 1cm; z-index: 0; pointer-events: none; opacity: .85;
  height: min(65vh, 702px); width: auto; aspect-ratio: 426/640; max-width: 39vw;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 32%);
  mask-image: linear-gradient(90deg, transparent, #000 32%);
}
#mora-base { width: 100%; height: 100%; display: block; object-fit: contain; object-position: top right; }
#mora-foto .gato { position: absolute; visibility: hidden; transform-origin: 50% 53%; will-change: transform; }
#mora-foto .eye { position: absolute; visibility: hidden; will-change: transform; }

.wrap { position: relative; z-index: 1; max-width: 1140px; margin: 0 auto; padding: 0 24px; }

/* ---------- Nav ---------- */
nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 30; padding: 14px 0;
  transition: background .3s, border-color .3s, backdrop-filter .3s;
}
nav.scrolled { background: rgba(5, 5, 5, .78); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); }
body[data-theme="light"] nav.scrolled { background: rgba(5, 5, 5, .78); }
nav .wrap { display: flex; align-items: center; gap: 20px; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 800; font-size: 1.15rem; color: var(--text); white-space: nowrap; margin-left: -2cm; }
.brand .dot { width: 11px; height: 11px; border-radius: 50%; background: var(--grad); box-shadow: 0 0 12px var(--cyan); flex: 0 0 auto; }
.brand .brand-name { display: inline-flex; align-items: baseline; gap: .3em; }
.brand .brand-system { color: var(--cyan); }
.brand-col { display: flex; flex-direction: column; gap: 6px; }
.logout-btn { background: rgba(255, 75, 43, .12); color: #ff6b5e; border: 1px solid #ff6b5e; border-radius: 7px; padding: 5px 11px; font-size: .72rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; cursor: pointer; font-family: inherit; align-self: flex-start; transition: .2s; }
.logout-btn:hover { background: rgba(255, 75, 43, .22); border-color: #ff8d83; color: #ff8d83; }
@keyframes brandPulse { 0%, 100% { opacity: 1; } 50% { opacity: .4; } }
nav .links { display: flex; flex-wrap: nowrap; gap: 22px; margin-left: auto; white-space: nowrap; }
nav .links a { color: var(--dim); font-size: .9rem; white-space: nowrap; transition: color .2s; }
nav .links a:hover { color: var(--text); text-decoration: none; }
nav .links a.active { color: var(--cyan); }
body[data-theme="light"] nav .links a.active { color: var(--azul); }

/* Skip link */
.skip-link { position: absolute; left: -9999px; top: 0; z-index: 100; background: var(--azul); color: #fff; padding: 10px 18px; border-radius: 0 0 10px 0; font-weight: 600; text-decoration: none; }
.skip-link:focus { left: 0; top: 0; }

/* Menú móvil */
.nav-toggle { display: none; background: transparent; border: 1px solid var(--border); color: var(--text); width: 42px; height: 42px; border-radius: 10px; cursor: pointer; font-size: 1.15rem; margin-left: auto; }

/* Foco visible */
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }

.btn { display: inline-flex; align-items: center; gap: 8px; font-family: inherit; font-size: .9rem; font-weight: 600; padding: 11px 20px; border-radius: 10px; border: 1px solid var(--border); background: var(--card2); color: var(--text); cursor: pointer; transition: .2s; text-decoration: none; }
.btn:hover { text-decoration: none; border-color: var(--cyan); transform: translateY(-1px); }
.btn.primary { background: var(--azul); border-color: var(--azul); }
.btn.primary:hover { background: #0a6bff; border-color: #0a6bff; }
.btn.ghost { background: transparent; }
.btn i { font-size: .85rem; }

/* Botón "Noticias" — mismos parámetros que el botón "Silenciar voz de Carmen" (mute-btn) */
.btn-noticias { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--card2); color: var(--text); font-family: inherit; font-size: 1.05rem; font-weight: 600; cursor: pointer; transition: .2s; text-decoration: none; flex-shrink: 0; align-self: center; }
.btn-noticias span { font-size: .76rem; font-weight: 800; font-style: italic; letter-spacing: .06em; white-space: nowrap; animation: hitlPulse 4s ease-in-out infinite; }
.btn-noticias:hover { border-color: var(--cyan); color: var(--cyan); text-decoration: none; }

/* Botón NOTICIAS — efecto radar (anillo expandiéndose) para diferenciarlo del de presentación */
.btn-noticias.radar { position: relative; }
.btn-noticias.radar span { animation: none; }
.btn-noticias.radar::after { content: ''; position: absolute; inset: 0; border-radius: 10px; border: 2px solid rgba(0, 210, 255, .7); opacity: 0; animation: radarRing 2s ease-out infinite; pointer-events: none; }
@keyframes radarRing { 0% { opacity: .8; box-shadow: 0 0 0 0 rgba(0, 210, 255, .5); } 70%, 100% { opacity: 0; box-shadow: 0 0 0 9px rgba(0, 210, 255, 0); } }

/* ---------- Idioma (selector ES/EN) ---------- */
.lang-bar { display: flex; gap: 6px; transform: translateX(-3cm); }
.lang-btn { background: transparent; border: 1px solid var(--border); color: var(--dim); padding: 6px 11px; border-radius: 8px; cursor: pointer; font-size: .78rem; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; transition: .2s; font-family: inherit; white-space: nowrap; }
.lang-btn .flag { font-size: .95rem; line-height: 1; }
.lang-btn:hover { border-color: var(--cyan); color: var(--text); }
.lang-btn.active { background: rgba(0, 210, 255, .12); border-color: var(--cyan); color: var(--cyan); }
body[data-theme="light"] .lang-btn.active { background: rgba(0, 98, 255, .1); border-color: var(--azul); color: var(--azul); }

/* ---------- Hero (pantalla Inicio) ---------- */
.hero { min-height: 100vh; display: flex; align-items: center; padding: 128px 0 88px; background: radial-gradient(58% 46% at 50% 0%, rgba(0, 98, 255, .15), transparent 72%); }
.hero .eyebrow { display: inline-flex; align-items: center; gap: 9px; font-size: .75rem; letter-spacing: .15em; text-transform: uppercase; color: var(--cyan); margin-bottom: 22px; font-weight: 700; background: rgba(0, 210, 255, .08); border: 1px solid rgba(0, 210, 255, .24); padding: 8px 15px; border-radius: 99px; cursor: pointer; font-family: inherit; -webkit-appearance: none; appearance: none; transition: background .2s, border-color .2s; }
.hero .eyebrow:hover { background: rgba(0, 210, 255, .14); border-color: rgba(0, 210, 255, .5); }
.hero .eyebrow .pulse { width: 9px; height: 9px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 0 0 rgba(0, 210, 255, .6); filter: drop-shadow(0 0 4px rgba(0, 210, 255, .75)); animation: heroPulse 2.4s infinite; }
.hero .eyebrow .hitl { font-size: 1.5em; font-weight: 800; font-style: italic; animation: hitlPulse 4s ease-in-out infinite; }
.hero .auth-row { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; margin-bottom: 24px; }
.hero .auth-btn { display: inline-flex; align-items: center; gap: 6px; font-size: 0.91rem; letter-spacing: .12em; text-transform: uppercase; font-weight: 800; padding: 9px 17px; border-radius: 99px; cursor: pointer; font-family: inherit; line-height: 1; border: 1px solid transparent; -webkit-appearance: none; appearance: none; transition: background .2s, border-color .2s, transform .2s; }
.hero .auth-btn i { font-size: 0.64rem; }
.hero .auth-btn.invitado { position: relative; background: var(--azul); border-color: var(--azul); color: #fff; text-decoration: none; }
.hero .auth-btn.invitado:hover { background: #0a6bff; border-color: #0a6bff; transform: translateY(-1px); text-decoration: none; }
.hero .auth-btn.google { position: relative; background: #d6f5e6; border-color: #a9e3c8; color: #0b5c3a; text-transform: none; letter-spacing: .01em; }
.hero .auth-btn.google:hover { background: #c2ecd8; border-color: #8fd9b4; transform: translateY(-1px); }
@keyframes hitlPulse {
  0%, 100% { opacity: .15; color: #00d2ff; }
  25% { opacity: 1; color: #a78bfa; }
  50% { opacity: 1; color: #f59e0b; }
  75% { opacity: 1; color: #10b981; }
}
@keyframes heroPulse { 0% { box-shadow: 0 0 0 0 rgba(0, 210, 255, .6); } 70% { box-shadow: 0 0 0 15px rgba(0, 210, 255, 0); } 100% { box-shadow: 0 0 0 0 rgba(0, 210, 255, 0); } }
.hero h1 { font-size: clamp(2.55rem, 6.8vw, 4.76rem); font-weight: 800; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; margin-bottom: 12px; letter-spacing: -.03em; white-space: nowrap; }
.hero .tag { font-size: clamp(1.2rem, 2.6vw, 1.6rem); color: var(--text); font-weight: 600; margin-bottom: 20px; }
.hero .tag .accent { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p { color: var(--dim); max-width: 620px; font-size: 1.06rem; margin-bottom: 30px; }
.hero .cta { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 30px; }
.hero .cta .btn { font-size: .95rem; padding: 13px 24px; }
.hero-trust { display: flex; flex-wrap: wrap; gap: 10px; }
.hero-trust .pill { display: inline-flex; align-items: center; gap: 8px; font-size: .82rem; color: var(--dim); background: rgba(255, 255, 255, .03); border: 1px solid var(--border); border-radius: 99px; padding: 8px 14px; font-weight: 600; text-decoration: none; }
.hero-trust .pill i { color: var(--cyan); font-size: .78rem; }
.hero-trust .pill:hover { border-color: var(--ring); color: var(--text); text-decoration: none; }

/* ---------- Secciones ---------- */
section { position: relative; z-index: 1; padding: 90px 0; }
section.alt { background: rgba(255, 255, 255, .03); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.sec-head { margin-bottom: 48px; }
.sec-head .kicker { font-size: .76rem; letter-spacing: .16em; text-transform: uppercase; color: var(--cyan); font-weight: 600; margin-bottom: 10px; }
.sec-head h2 { font-size: clamp(2rem, 4.6vw, 3.2rem); font-weight: 600; margin-bottom: 14px; }
.sec-head p { color: var(--dim); max-width: 640px; }

.grid { display: grid; gap: 18px; }
.grid.c3 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid.c4 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }

.card { background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 26px; transition: transform .25s, border-color .25s, box-shadow .25s; }
.card:hover { transform: translateY(-4px); border-color: var(--ring); }
#seguridad .card { background: transparent; }
.card .ico { width: 46px; height: 46px; border-radius: 12px; display: flex; align-items: center; justify-content: center; background: rgba(0, 98, 255, .14); color: var(--cyan); font-size: 1.25rem; margin-bottom: 18px; }
.card h3 { font-size: 1.3rem; margin-bottom: 10px; }
.card p { color: var(--dim); font-size: 1.08rem; }
.card .go { display: inline-flex; align-items: center; gap: 7px; margin-top: 16px; font-size: .86rem; font-weight: 600; color: var(--cyan); text-decoration: none; }
.card .go:hover { text-decoration: underline; color: var(--azul); }
.card .go + .go { margin-left: 16px; }

.tagline { display: flex; width: fit-content; margin-left: auto; margin-right: auto; align-items: center; gap: 8px; font-size: 1.12rem; color: var(--ok); background: rgba(16, 185, 129, .1); padding: 8px 16px; border-radius: 99px; margin-bottom: 18px; font-weight: 700; animation: taglinePulse 6s ease-in-out infinite; }
@keyframes taglinePulse {
  0%, 100% { opacity: .25; color: #10b981; }
  25% { opacity: 1; color: #00d2ff; }
  50% { opacity: 1; color: #a78bfa; }
  75% { opacity: 1; color: #f59e0b; }
}

/* ---------- Marco M.O.R.A. ---------- */
.mora { display: grid; gap: 16px; }
.mora-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.mora-item { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 20px; border-left: 3px solid var(--azul); }
.mora-item h4 { font-size: 1.2rem; margin-bottom: 8px; }
.mora-item p { color: var(--dim); font-size: 1.05rem; }
#mora .mora-item { background: transparent; }

/* ---------- Pipeline / Cómo funciona ---------- */
.pipeline { list-style: none; margin: 0; padding: 0; max-width: 560px; }
.pipeline li { display: flex; gap: 16px; padding: 9px 0; position: relative; }
.pipeline li:not(:last-child)::before { content: ''; position: absolute; left: 17px; top: 40px; bottom: -4px; width: 2px; background: linear-gradient(var(--azul), var(--cyan)); opacity: .35; }
.pipeline .num { flex: 0 0 auto; width: 36px; height: 36px; border-radius: 50%; background: var(--card2); border: 1px solid var(--border); color: var(--cyan); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: .85rem; z-index: 1; }
.pipeline b { display: block; font-family: var(--font-display); font-size: 1.02rem; color: var(--text); margin-bottom: 2px; }
.pipeline small { color: var(--dim); font-size: .82rem; line-height: 1.4; }
.pipeline li.human { background: rgba(0, 210, 255, .06); border: 1px solid var(--ring); border-radius: 12px; padding: 13px 16px; margin: 5px 0; }
.pipeline li.human::before { display: none; }
.pipeline li.human .num { background: var(--grad); color: #fff; border-color: transparent; }
.pipeline li.human b { color: var(--cyan); text-transform: uppercase; letter-spacing: .06em; }

/* ---------- Tres niveles de IA responsable ---------- */
.niveles { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; }
.nivel { background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 28px; position: relative; }
.nivel-num { font-family: var(--font-display); font-weight: 800; font-size: 2.5rem; line-height: 1; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; margin-bottom: 12px; }
.n-tag { display: block; font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; font-weight: 600; color: var(--cyan); margin-bottom: 10px; }
.nivel h3 { font-size: 1.12rem; margin-bottom: 10px; }
.nivel p { color: var(--dim); font-size: .9rem; }
.nivel.destacada { background: linear-gradient(180deg, rgba(0, 210, 255, .10), rgba(0, 98, 255, .04)); border: 1px solid var(--ring); box-shadow: 0 0 24px rgba(0, 210, 255, .12); }

/* ---------- Flujo de pasos ---------- */
.flujo { display: flex; flex-wrap: wrap; gap: 12px; list-style: none; margin: 0; padding: 0; }
.flujo li { flex: 1 1 150px; background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 20px; position: relative; }
.flujo li::after { content: '→'; position: absolute; right: -13px; top: 50%; transform: translateY(-50%); color: var(--cyan); font-weight: 700; font-size: 1.2rem; }
.flujo li:last-child::after { content: none; }
.flujo span { display: inline-block; font-family: var(--font-display); font-weight: 800; font-size: 1.4rem; color: var(--cyan); margin-bottom: 8px; }
.flujo b { display: block; font-size: 1.3rem; margin-bottom: 4px; }
.flujo small { color: var(--dim); font-size: 1.05rem; line-height: 1.45; }
#escalabilidad .flujo li { background: transparent; }

/* ---------- Bloque destacado (demo / CTA) ---------- */
.destacado { background: linear-gradient(135deg, rgba(0, 98, 255, .12), rgba(0, 210, 255, .06)); border: 1px solid var(--ring); border-radius: 18px; padding: 34px; text-align: center; max-width: 70%; margin: 0 20% 0 10%; }
.destacado h3 { font-size: 1.5rem; margin-bottom: 10px; }
.destacado p { color: var(--dim); max-width: 620px; margin: 0 auto 22px; }

/* ---------- Asistente ---------- */
.chat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; max-width: 80%; }
.chat-card { background: var(--card); border: 1px solid var(--border); border-radius: 18px; padding: 30px; display: flex; flex-direction: column; gap: 16px; }
.chat-card h3 { font-size: 1.3rem; }
.chat-card .card-head { display: flex; align-items: center; gap: 16px; }
.chat-card .carmen-name { font-family: var(--font-display); font-weight: 800; font-size: 3.3rem; letter-spacing: .04em; text-transform: uppercase; color: var(--azul); line-height: 1; }
.chat-card p { color: var(--dim); flex: 1; }

/* ---------- Contacto ---------- */
.contact { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: end; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: .95rem; color: var(--dim); margin-bottom: 6px; }
.field input, .field textarea { width: 100%; background: var(--card2); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; color: var(--text); font-family: inherit; font-size: 1.05rem; }
.field input:focus, .field textarea:focus { border-color: var(--cyan); outline: 2px solid var(--cyan); outline-offset: 1px; }
.field textarea { resize: vertical; min-height: 110px; }
.consent { display: flex; gap: 12px; align-items: flex-start; font-size: .95rem; line-height: 1.5; color: var(--dim); margin: 16px 0; }
.consent input { margin-top: 5px; accent-color: var(--azul); }
.consent-text { white-space: nowrap; }
.contact-info { background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 20px; }
#contacto .contact-info { background: transparent; }
.contact-info h3 { font-size: 1.25rem; margin-bottom: 14px; }
.contact-info .row { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 12px; color: var(--dim); font-size: 1.05rem; }
.contact-info .row i { color: var(--cyan); width: 18px; margin-top: 3px; }
.contact-info .row b { color: var(--text); font-weight: 600; }

/* ---------- Superposición cuántica en tarjetas (pantallas centrales) ---------- */
body[data-theme="light"] .card,
body[data-theme="light"] .nivel,
body[data-theme="light"] .mora-item,
body[data-theme="light"] .chat-card,
body[data-theme="light"] .flujo li {
  position: relative;
  z-index: 0;
}
body[data-theme="light"] .card::before,
body[data-theme="light"] .nivel::before,
body[data-theme="light"] .mora-item::before,
body[data-theme="light"] .chat-card::before,
body[data-theme="light"] .flujo li::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(0, 210, 255, .3), rgba(167, 139, 250, .3));
  filter: blur(14px);
  opacity: .55;
  z-index: -1;
  pointer-events: none;
  transform: translate(4px, 5px);
  animation: quantumGhost 6s ease-in-out infinite;
  transition: opacity .5s;
}
body[data-theme="light"] .card:hover::before,
body[data-theme="light"] .nivel:hover::before,
body[data-theme="light"] .mora-item:hover::before,
body[data-theme="light"] .chat-card:hover::before,
body[data-theme="light"] .flujo li:hover::before {
  opacity: 0;
}
@keyframes quantumGhost {
  0%, 100% { transform: translate(4px, 5px); }
  50% { transform: translate(-3px, 3px); }
}

/* ---------- Redes ---------- */
.social { display: flex; gap: 12px; flex-wrap: wrap; }
.social a { width: 34px; height: 34px; border-radius: 10px; display: flex; align-items: center; justify-content: center; background: var(--card2); border: 1px solid var(--border); color: var(--dim); font-size: .95rem; transition: .2s; }
.social a:hover { color: var(--text); border-color: var(--cyan); transform: translateY(-2px); text-decoration: none; }

/* ---------- Footer ---------- */
footer { position: relative; z-index: 1; border-top: 1px solid var(--border); padding: 36px 0; background: rgba(5, 5, 5, .85); }
footer .wrap { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: flex-start; justify-content: space-between; }
footer .legal { display: flex; gap: 18px; flex-wrap: wrap; font-size: .82rem; }
footer .legal a { color: var(--dim); }
footer .legal a:hover { color: var(--text); }
footer .copy { color: var(--dim); font-size: .78rem; line-height: 1.55; }
footer .copy[style*="width:100%"] { margin-top: 6px; padding-top: 12px; border-top: 1px solid var(--border); }
footer .copy[style*="width:100%"] + footer .copy[style*="width:100%"] { margin-top: 0; padding-top: 0; border-top: 0; }

/* ---------- Sonido ambiental (botón inferior izquierda) ---------- */
.ambient-toggle { position: fixed; bottom: 24px; left: 24px; z-index: 40; width: 46px; height: 46px; border-radius: 50%; background: rgba(13, 13, 16, .72); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border: 1px solid var(--border); color: var(--dim); cursor: pointer; font-size: 1rem; display: flex; align-items: center; justify-content: center; transition: .25s; }
.ambient-toggle:hover { border-color: var(--cyan); color: var(--cyan); transform: translateY(-2px); }
.ambient-toggle.on { color: var(--cyan); border-color: var(--ring); box-shadow: 0 0 16px rgba(0, 210, 255, .25); }

/* QR de instalación de la MORA App (PWA) — columna izquierda, entre orbe y altavoz */
.qr-app { position: fixed; left: 81px; top: calc(50% + 113px); transform: translateY(-50%); z-index: 40; display: flex; flex-direction: column; align-items: center; gap: 8px; text-decoration: none; background: rgba(13, 13, 16, .72); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border: 1px solid var(--border); border-radius: 16px; padding: 12px; transition: .25s; }
.qr-app:hover { border-color: var(--cyan); text-decoration: none; transform: translateY(-50%) translateY(-2px); }
.qr-app img { width: 128px; height: 128px; border-radius: 8px; display: block; }
.qr-app-label { font-size: .68rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--cyan); white-space: nowrap; }

/* ============================================================
   Tema claro (Apple) — refinamientos
   ============================================================ */
body[data-theme="light"] .sec-head .kicker { color: var(--cyan); }
/* Fondo atenuado (oscuro) en pantallas claras: el texto directo y el nav pasan a claro */
body[data-theme="light"] .sec-head h2,
body[data-theme="light"] .pipeline b,
body[data-theme="light"] #mora .mora-item h4,
body[data-theme="light"] #escalabilidad .flujo b { color: #f8fafc; }
body[data-theme="light"] .sec-head p,
body[data-theme="light"] .pipeline small,
body[data-theme="light"] #mora .mora-item p,
body[data-theme="light"] #escalabilidad .flujo small { color: #94a3b8; }
body[data-theme="light"] nav .links a { color: #94a3b8; }
body[data-theme="light"] nav .links a:hover { color: #f8fafc; }
body[data-theme="light"] .card,
body[data-theme="light"] .nivel,
body[data-theme="light"] .mora-item,
body[data-theme="light"] .chat-card,
body[data-theme="light"] .contact-info {
  box-shadow: 0 1px 3px rgba(0, 0, 0, .06);
}
body[data-theme="light"] .card { border-radius: 18px; }
body[data-theme="light"] .card:hover { border-color: var(--azul); box-shadow: 0 12px 30px rgba(0, 0, 0, .08); }
body[data-theme="light"] .card .ico { background: rgba(0, 98, 255, .1); color: var(--azul); }
body[data-theme="light"] .card .go { color: var(--azul); }
body[data-theme="light"] .flujo li { box-shadow: 0 1px 3px rgba(0, 0, 0, .06); }
body[data-theme="light"] .flujo span,
body[data-theme="light"] .flujo li::after,
body[data-theme="light"] .n-tag { color: var(--azul); }
body[data-theme="light"] .pipeline .num { color: var(--azul); }
body[data-theme="light"] .mora-item { border-left-color: var(--azul); }
body[data-theme="light"] .contact-info .row i { color: var(--azul); }
body[data-theme="light"] footer { background: rgba(5, 5, 5, .85); }
body[data-theme="light"] footer .legal a,
body[data-theme="light"] footer .copy { color: #94a3b8; }
body[data-theme="light"] footer .legal a:hover { color: #f8fafc; }

/* Banda oscura de contraste (dentro de pantallas claras) */
.band-dark { background: #050505; color: #f8fafc; border-radius: 24px; padding: 56px 48px; margin: 48px 0; }
.band-dark h2, .band-dark h3 { color: #f8fafc; }
.band-dark p { color: #94a3b8; }
#screen-escalabilidad .band-dark h2 { font-size: clamp(1.8rem, 3.6vw, 2.5rem); }
#screen-escalabilidad .band-dark p { font-size: 1.1rem; }
.band-dark .card, .band-dark .nivel, .band-dark .mora-item, .band-dark .flujo li, .band-dark .chat-card {
  background: rgba(255, 255, 255, .06); border-color: rgba(255, 255, 255, .12); box-shadow: none;
}
.band-dark .card h3, .band-dark .nivel h3, .band-dark .mora-item h4, .band-dark .chat-card h3 { color: #f8fafc; }
.band-dark .card p, .band-dark .nivel p, .band-dark .mora-item p, .band-dark .chat-card p { color: #94a3b8; }
.band-dark .n-tag, .band-dark .card .go, .band-dark .card .ico { color: var(--cyan); }

/* Fondo de decorado a carboncillo por pantalla (detalles: ladrillo, madera, luces indirectas) */
#screen-contexto .band-dark { background: linear-gradient(rgba(5,5,5,.74), rgba(5,5,5,.74)), url("fotos/aula-ia.jpg") center/cover; }
#screen-como-funciona .band-dark { background: linear-gradient(rgba(5,5,5,.74), rgba(5,5,5,.74)), url("bg-wood.jpg") center/cover; }
#screen-carmen .band-dark { background: linear-gradient(rgba(5,5,5,.70), rgba(5,5,5,.70)), url("bg-light.jpg") center/cover; }
#screen-mora .band-dark { background: linear-gradient(rgba(5,5,5,.74), rgba(5,5,5,.74)), url("bg-board.jpg") center/cover; }
#screen-normativa .band-dark { background: linear-gradient(rgba(5,5,5,.76), rgba(5,5,5,.76)), url("bg-brick.jpg") center/cover; }
#screen-escalabilidad .band-dark { background: linear-gradient(rgba(5,5,5,.74), rgba(5,5,5,.74)), url("bg-light.jpg") center/cover; }

/* Aviso de datos de alto riesgo (pantalla Contacto) */
.risk-note { display: inline-flex; align-items: center; gap: 10px; font-size: .82rem; font-weight: 600; color: var(--warn); background: rgba(255, 209, 102, .1); border: 1px solid rgba(255, 209, 102, .3); padding: 10px 16px; border-radius: 99px; margin-bottom: 28px; }
/* Encabezado de Contacto desplazado a la derecha del orbe */
#screen-contacto .sec-head,
#screen-contacto .risk-note {
  margin-left: calc(clamp(200px, 30vw, 430px) - 5.5cm);
}
.risk-note i { color: var(--warn); }
.shield-ping { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 1.6em; height: 1.6em; line-height: 1; }
.shield-ping i { line-height: 1; }
.shield-ping::after { content: ''; position: absolute; top: 50%; left: 50%; width: 1.8em; height: 1.8em; border-radius: 50%; border: 2.5px solid rgba(255, 209, 102, .9); opacity: 0; transform: translate(-50%, -50%) scale(.5); animation: radarPing 2.2s ease-out infinite; pointer-events: none; }
@keyframes radarPing { 0% { transform: translate(-50%, -50%) scale(.5); opacity: 1; } 80%, 100% { transform: translate(-50%, -50%) scale(2.1); opacity: 0; } }
@media (max-width: 820px) {
  #screen-contacto .sec-head,
  #screen-contacto .risk-note { margin-left: 0; }
}

/* ---------- SPA: pantallas ---------- */
.screen { display: none; min-height: 100vh; padding: 130px 0 80px; }
#screen-inicio { padding: 0; }
.screen.active { display: block; animation: screenIn .5s ease; }
@keyframes screenIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* ---------- Responsive ---------- */
@media (max-width: 820px) {
  .lang-bar { transform: none; }
  nav .wrap { gap: 10px; }
  .brand { margin-left: 0; }
  .brand-col { flex: 1 1 auto; min-width: 0; }
  .brand .brand-name { font-size: .95rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
  nav .links { display: none; }
  .nav-toggle { display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
  nav .links.open { display: flex; flex-direction: column; position: absolute; top: 100%; left: 0; right: 0; background: rgba(5, 5, 5, .98); padding: 16px 24px; gap: 14px; border-bottom: 1px solid var(--border); margin: 0; }
  body[data-theme="light"] nav .links.open { background: rgba(5, 5, 5, .98); }
  .qr-app { display: none; }
  .contact { grid-template-columns: 1fr; }
  .hero { padding: 110px 0 60px; }
  #mora-foto { height: 31vh; max-width: 57vw; }
  .destacado { max-width: 100%; margin: 0; }
  .chat-grid { max-width: 100%; }
  .chat-card .carmen-name { font-size: 2.4rem; }
  .band-dark { padding: 40px 28px; }
}

/* ---------- Reducción de movimiento (accesibilidad) ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* ---------- Frase IA (esquina inferior derecha) ---------- */
#frase-ia { position: fixed; bottom: calc(34px + 10mm); right: calc(34px + 30mm); z-index: 0; pointer-events: none; text-align: right; font-family: var(--font-display); font-weight: 800; line-height: 1.12; font-size: clamp(20.4px, 2.04vw, 32.4px); opacity: .88; text-shadow: 0 0 18px rgba(0, 162, 255, .35), 0 2px 0 rgba(0, 40, 110, .55); }
#frase-ia .azul { color: #0062ff; }
#frase-ia .blanco { color: #ffffff; }
@media (max-width: 820px) { #frase-ia { font-size: 18px; bottom: calc(20px + 10mm); right: calc(20px + 30mm); } }

/* ---------- Orbe de red neuronal (abajo-izquierda) ---------- */
#orb { position: fixed; top: 10mm; left: 10mm; z-index: 0; pointer-events: none; opacity: .85; transform: translateY(3vh); }

/* ---------- Modal HITL (Supervisor humano) ---------- */
.modal { position: fixed; inset: 0; z-index: 100; background: rgba(5, 5, 5, .55); display: none; align-items: center; justify-content: center; padding: 20px; }
.modal.open { display: flex; }
.modal .box { background: #fff; color: #1d1d1f; border-radius: 16px; max-width: 640px; width: 100%; max-height: 85vh; overflow: auto; padding: 28px; box-shadow: 0 24px 60px rgba(0, 0, 0, .35); }
.modal .box h2 { margin-top: 0; color: #1d1d1f; }
.modal .box h3 { margin: 18px 0 6px; color: #1d1d1f; }
.modal .box p, .modal .box li { color: #3a3a3f; font-size: .95rem; }
.modal .box ul { margin: 8px 0; }
.modal .close { float: right; background: none; border: none; font-size: 24px; line-height: 1; cursor: pointer; color: #6e6e73; padding: 0 4px; }
.modal .close:hover { color: #1d1d1f; }
.modal .login-box { max-width: 400px; }

/* Modal HITL — fondo oscuro atenuado para evitar deslumbramiento sobre la landing oscura */
#hitl-modal .box { background: var(--card2); color: var(--text); border: 1px solid var(--border); }
#hitl-modal .box h2, #hitl-modal .box h3 { color: var(--text); }
#hitl-modal .box p, #hitl-modal .box li { color: var(--dim); }
#hitl-modal .box strong { color: var(--text); }
#hitl-modal .close { color: var(--dim); }
#hitl-modal .close:hover { color: var(--text); }

/* Modal Login — mismo tratamiento oscuro que el HITL */
#login-modal .box { background: var(--card2); color: var(--text); border: 1px solid var(--border); }
#login-modal .box h2 { color: var(--text); }
#login-modal .login-sub { color: var(--dim); }
#login-modal .login-divider { color: var(--dim); }
#login-modal .login-divider::before, #login-modal .login-divider::after { background: var(--border); }
#login-modal .field label { color: var(--dim); }
#login-modal .field input { background: var(--bg2); border: 1px solid var(--border); color: var(--text); }
#login-modal .google-btn { background: #1c1f26; color: var(--text); border: 1px solid var(--border); }
#login-modal .google-btn:hover { background: #252932; border-color: var(--cyan); }
#login-modal .login-msg { color: var(--warn); }
#guest-modal .box { background: var(--card2); color: var(--text); border: 1px solid var(--border); }
#guest-modal .box h2 { color: var(--text); }
#guest-modal .login-sub { color: var(--dim); }
#guest-modal .login-sub a { color: var(--cyan); }
#guest-modal .login-msg { color: var(--warn); }
#login-modal .close { color: var(--dim); }
#login-modal .close:hover { color: var(--text); }
.login-box .login-sub { color: #6e6e73; font-size: .92rem; margin: -6px 0 18px; }
.login-box .google-btn { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; font-family: inherit; font-size: 1rem; font-weight: 700; color: #1d1d1f; background: #fff; border: 1px solid #d2d2d7; border-radius: 10px; padding: 12px 16px; cursor: pointer; transition: .2s; }
.login-box .google-btn:hover { background: #f5f5f7; border-color: #b8b8bd; }
.login-box .google-btn i { font-size: 1.15rem; color: #4285F4; }
.login-divider { display: flex; align-items: center; gap: 12px; color: #86868b; font-size: .78rem; margin: 18px 0; text-transform: uppercase; letter-spacing: .06em; }
.login-divider::before, .login-divider::after { content: ''; flex: 1; height: 1px; background: #e5e5ea; }
.login-box .field { margin-bottom: 14px; }
.login-box .field label { color: #6e6e73; }
.login-box .field input { background: #f5f5f7; border: 1px solid #d2d2d7; border-radius: 10px; padding: 12px 14px; color: #1d1d1f; font-size: 1rem; }
.login-box .field input:focus { border-color: var(--azul); outline: 2px solid rgba(0, 98, 255, .25); }
.login-box .btn.primary { width: 100%; justify-content: center; font-size: 1rem; }
.login-msg { margin-top: 14px; font-size: .86rem; color: #8a6d00; }

/* ============================================================
   Estilo Squarespace — reveal, progreso y fotos de fondo
   ============================================================ */

/* Barra de progreso de scroll */
#progress { position: fixed; top: 0; left: 0; height: 3px; width: 0; z-index: 60; background: var(--grad); }

/* Fotografías de fondo giratorias (enseñanza compartida con IA) */
#bg-fotos { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
#bg-fotos .foto { position: absolute; inset: 0; background-size: cover; background-position: center; opacity: 0; transform: scale(1.07); transition: opacity 1.8s ease, transform 8s ease; will-change: opacity, transform; }
#bg-fotos .foto.activa { opacity: 1; transform: scale(1); }
#bg-fotos::after { content: ''; position: absolute; inset: 0; }
body[data-theme="dark"] #bg-fotos::after { background: linear-gradient(180deg, rgba(5,5,5,.86), rgba(5,5,5,.93)); }
body[data-theme="light"] #bg-fotos::after {
  background: linear-gradient(180deg, rgba(10, 14, 22, .82), rgba(10, 14, 22, .9));
}
/* Malla neuronal: nodos que respiran (se desvanecen y reaparecen) */
body[data-theme="light"]::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: radial-gradient(circle, rgba(167, 139, 250, .4) 1.3px, transparent 2px);
  background-size: 28px 28px;
  animation: latticeBreathe 7s ease-in-out infinite,
             latticeHue 18s ease-in-out infinite alternate;
}
@keyframes latticeBreathe { 0%, 100% { opacity: 0; } 50% { opacity: .8; } }
@keyframes latticeHue { from { filter: hue-rotate(-65deg); } to { filter: hue-rotate(40deg); } }

/* Reveal al hacer scroll (progresiones) — animation, no transition,
   para no pisar el hover de las tarjetas */
.reveal { opacity: 0; }
.reveal.in { animation: revealUp .8s cubic-bezier(.16,.84,.44,1) both; animation-delay: var(--d, 0ms); }
@keyframes revealUp {
  from { opacity: 0; translate: 0 28px; }
  to   { opacity: 1; translate: 0 0; }
}

/* ============================================================
   MORA App — teléfono (PWA) dentro de la landing
   ============================================================ */
#screen-app .app-wrap { display: flex; flex-direction: column; align-items: center; }
#screen-app .sec-head { text-align: center; }
#screen-app .sec-head p { margin-left: auto; margin-right: auto; }

.phone {
  position: relative;
  width: 360px;
  max-width: 92vw;
  background: #07080c;
  border: 1px solid var(--border);
  border-radius: 46px;
  box-shadow: 0 0 0 10px #0b0c11, 0 0 0 11px var(--border), 0 30px 80px rgba(0, 0, 0, .6), 0 0 60px rgba(0, 210, 255, .12);
  overflow: hidden;
  padding: 14px 14px 16px;
}
.phone-notch {
  position: absolute; top: 14px; left: 50%; transform: translateX(-50%);
  width: 120px; height: 22px; border-radius: 14px; background: #000;
  z-index: 5; box-shadow: inset 0 0 0 1px rgba(255,255,255,.04);
}
.phone-screen {
  background: linear-gradient(180deg, #0a0d14 0%, #05070c 100%);
  border-radius: 34px;
  padding: 52px 16px 18px;
  min-height: 560px;
  display: flex; flex-direction: column; gap: 16px;
  color: var(--text);
}
.p-app-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.p-app-brand { display: flex; align-items: center; gap: 9px; }
.p-app-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--grad); box-shadow: 0 0 10px var(--cyan); flex-shrink: 0; }
.p-app-name { font-family: var(--font-display); font-weight: 800; font-size: 1.02rem; letter-spacing: -.01em; }
.p-app-status { display: inline-flex; align-items: center; background: #d4f5d4; border-radius: 8px; padding: 5px 10px; white-space: nowrap; }
.p-app-status-plan { font-size: .72rem; font-weight: 900; color: #000000; letter-spacing: -.01em; }

.p-levels { display: flex; gap: 6px; background: var(--card2); border: 1px solid var(--border); border-radius: 12px; padding: 4px; }
.p-level { flex: 1; border: none; background: transparent; color: var(--dim); font-family: inherit; font-size: .78rem; font-weight: 700; letter-spacing: .04em; padding: 8px 4px; border-radius: 9px; cursor: pointer; transition: .2s; }
.p-level.active { background: var(--azul); color: #fff; }
.p-level:hover { color: var(--text); }

.p-section-title { display: flex; align-items: center; gap: 8px; font-size: .8rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--cyan); }
.p-section-title i { font-size: .85rem; }

.p-agents { display: flex; flex-direction: column; gap: 8px; }
.p-agent {
  display: flex; align-items: center; gap: 12px;
  background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 11px 13px;
  transition: border-color .2s, transform .2s;
}
.p-agent:hover { border-color: var(--ring); }
.p-agent-ico { width: 36px; height: 36px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 1rem; flex-shrink: 0; }
.p-agent-body { flex: 1; display: flex; flex-direction: column; }
.p-agent-body b { font-size: .94rem; font-weight: 700; }
.p-agent-body small { color: var(--dim); font-size: .74rem; }
.p-agent-st { color: var(--ok); font-size: .55rem; }

.p-lock {
  display: flex; align-items: center; gap: 8px; justify-content: center;
  font-size: .76rem; color: var(--dim); background: var(--card); border: 1px dashed var(--border);
  border-radius: 12px; padding: 10px 14px;
}
.p-lock i { color: var(--warn); }

.p-record { background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 14px; display: flex; flex-direction: column; gap: 14px; }
.p-rec-fields { display: flex; flex-direction: column; gap: 8px; }
.p-rec-field { display: flex; align-items: center; gap: 9px; background: var(--bg2); border: 1px solid var(--border); border-radius: 10px; padding: 8px 12px; }
.p-rec-field i { color: var(--dim); font-size: .8rem; }
.p-rec-field input { flex: 1; background: transparent; border: none; outline: none; color: var(--text); font-family: inherit; font-size: .82rem; }
.p-rec-field input::placeholder { color: var(--dim); }
.p-rec-flow { display: flex; align-items: center; justify-content: space-between; gap: 4px; }
.p-rec-step { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 5px; text-align: center; }
.p-rec-step i { font-size: 1.1rem; color: var(--cyan); }
.p-rec-step span { font-size: .68rem; color: var(--dim); font-weight: 600; }
.p-rec-arrow { color: var(--cyan); font-size: .9rem; flex-shrink: 0; }
.p-rec-note { display: flex; align-items: flex-start; gap: 8px; font-size: .72rem; color: var(--dim); line-height: 1.4; }
.p-rec-note i { color: var(--ok); flex-shrink: 0; margin-top: 2px; }

.phone-home { width: 120px; height: 5px; border-radius: 99px; background: rgba(255,255,255,.18); margin: 16px auto 2px; }

/* Nivel activo: acento de marca */

@media (max-width: 820px) {
  .phone { border-radius: 40px; }
  .phone-screen { min-height: 520px; }
}

/* ---------- Presentación en pantalla completa ---------- */
.modal.presentacion {
  background: #000;
  padding: 0;
  z-index: 200;
}
.modal.presentacion video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}
.presentacion-close {
  position: absolute; top: 18px; right: 22px; z-index: 10;
  background: rgba(0,0,0,.5); color: #fff; border: 1px solid rgba(255,255,255,.25);
  width: 44px; height: 44px; border-radius: 50%; font-size: 26px; line-height: 1;
  cursor: pointer; transition: .2s;
}
.presentacion-close:hover { background: rgba(255,255,255,.2); }

@media (max-width: 820px) {
  .hero-video { margin-top: 28px; }
}
