/* ═══════════════════════════════════════════════════════════════
   MPH+ · CAPA DE MIEMBRO
   Lo que ve quien está dentro de la suscripción: barra de acceso con
   estado real (bridge), sello "+", ficha de herramienta, puerta de acceso
   y el modo "instrumento" (oscuro) de las herramientas.

   Solo presentación. No toca acceso, pagos, cuentas ni lógica clínica.
   Regla de color: el ámbar (#E8960C) marca "esto está dentro de tu
   acceso" (línea superior, sello, ficha). El rojo sigue siendo acción y
   señal clínica. Tipografías: Barlow Condensed + DM Sans.
═══════════════════════════════════════════════════════════════ */

:root {
  --mx-deep:  #08121C;
  --mx-ink:   #0D1B2A;
  --mx-ink-2: #1A2B3C;
  --mx-ink-3: #213548;
  --mx-red:   #CC2936;
  --mx-amber: #E8960C;
  --mx-t1:    #F0F2F4;
  --mx-t2:    #C3CFDB;
  --mx-t3:    #9FB0C2;
  --mx-line:  rgba(240, 242, 244, .12);
  --mx-gold:  rgba(232, 150, 12, .42);
  --mx-ease:  cubic-bezier(.16, 1, .3, 1);
  --mx-d: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  --mx-b: 'DM Sans', system-ui, sans-serif;
  --mx-nav: 60px;
}
@media (max-width: 768px) { :root { --mx-nav: 48px; } }

/* ── Sello "+" ─────────────────────────────────────────────── */
.mx-seal {
  display: inline-block; flex: none; width: 20px; height: 20px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='11.5' fill='%23E8960C'/%3E%3Cpath d='M12 6.2v11.6M6.2 12h11.6' stroke='%230D1B2A' stroke-width='2.5' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat;
}
.mx-seal--lg { width: 48px; height: 48px; }
.mx-seal--off { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='10.8' fill='none' stroke='%239FB0C2' stroke-width='1.4'/%3E%3Cpath d='M12 7v10M7 12h10' stroke='%239FB0C2' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E"); }

/* ── Barra de miembro (ruta + estado de acceso) ────────────── */
.mx-bar {
  position: relative; background: var(--mx-deep); color: var(--mx-t2);
  border-bottom: 1px solid var(--mx-line); font-family: var(--mx-b); font-size: 14px; line-height: 1.3;
}
.mx-bar::before {
  content: ''; position: absolute; left: 0; right: 0; top: 0; height: 2px; background: var(--mx-amber);
  transform-origin: left; animation: mx-draw 1100ms var(--mx-ease) 100ms both;
}
@keyframes mx-draw { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.mx-bar__in {
  max-width: 1180px; margin: 0 auto; padding: 0 clamp(16px, 3vw, 32px);
  min-height: 50px; display: flex; align-items: center; justify-content: space-between; gap: 18px;
}
.mx-crumbs { display: flex; align-items: center; gap: 10px; min-width: 0; }
.mx-crumbs a { display: inline-flex; align-items: center; gap: 7px; color: var(--mx-t2); text-decoration: none; white-space: nowrap; transition: color 180ms; }
.mx-crumbs a:hover { color: #fff; }
.mx-crumbs a svg { width: 14px; height: 14px; }
.mx-crumbs i { font-style: normal; color: rgba(240, 242, 244, .34); }
.mx-crumbs [aria-current] { color: #fff; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mx-status { display: flex; align-items: center; gap: 10px; flex: none; font-size: 14px; }
.mx-status__t { color: #fff; font-weight: 500; white-space: nowrap; }
.mx-status__s { color: var(--mx-t3); white-space: nowrap; }
.mx-status__s b { color: var(--mx-t1); font-weight: 500; }
.mx-status a { color: var(--mx-amber); font-weight: 600; text-decoration: none; white-space: nowrap; background: linear-gradient(currentColor, currentColor) 0 100% / 0 1.5px no-repeat; padding-bottom: 2px; transition: background-size 260ms var(--mx-ease); }
.mx-status a:hover { background-size: 100% 1.5px; }
.mx-status[data-state="loading"] .mx-status__t { color: var(--mx-t3); font-weight: 400; }
.mx-status[data-state="loading"] .mx-seal { opacity: .4; }
.mx-status[data-state="member"] .mx-seal { animation: mx-pop 800ms var(--mx-ease) both; }
@keyframes mx-pop { from { transform: rotate(-90deg) scale(.5); opacity: 0; } to { transform: none; opacity: 1; } }
.mx-status[data-state="member"][data-soon="1"] .mx-status__s b { color: #F5B454; }
/* Variante ancha: alinea la barra con el .container de las páginas con hero */
.mx-bar--wide .mx-bar__in { max-width: var(--container-max, 1280px); padding-left: var(--cp-desk, 80px); padding-right: var(--cp-desk, 80px); }
@media (max-width: 1023px) { .mx-bar--wide .mx-bar__in { padding-left: var(--cp-tab, 40px); padding-right: var(--cp-tab, 40px); } }
@media (max-width: 767px) { .mx-bar--wide .mx-bar__in { padding-left: var(--cp-mob, 20px); padding-right: var(--cp-mob, 20px); } }
@media (max-width: 640px) {
  .mx-bar__in { min-height: 46px; gap: 12px; }
  .mx-status__s { display: none; }
  .mx-crumbs .mx-crumbs__mid { display: none; }
}

/* ── Ficha de herramienta / sección (serie + sello) ─────────── */
.mx-plate {
  display: flex; align-items: center; gap: 10px; padding-bottom: 14px; margin: 0 0 22px;
  border-bottom: 1px solid var(--mx-gold);
  font-family: var(--mx-d); font-weight: 700; font-size: 13px; letter-spacing: .16em; text-transform: uppercase; color: var(--mx-amber);
}
.mx-plate .mx-seal { width: 18px; height: 18px; }
.mx-plate { flex-wrap: wrap; row-gap: 8px; }
.mx-plate__cat { order: 3; flex: 1 0 100%; color: var(--mx-t2); font-weight: 600; letter-spacing: .1em; font-size: 12.5px; }
.mx-plate b { margin-left: auto; font-weight: 600; letter-spacing: .12em; color: var(--mx-t3); }

/* ── Puerta de acceso (contenido solo para suscriptores) ────── */
.mx-gate {
  position: fixed; inset: var(--mx-nav) 0 0 0; z-index: 5000; overflow: auto;
  display: flex; align-items: center; justify-content: center; padding: clamp(20px, 5vw, 56px);
  background:
    radial-gradient(900px 420px at 50% -80px, rgba(204, 41, 54, .16), transparent 70%),
    var(--mx-ink);
  font-family: var(--mx-b);
}
/* Bloqueo mientras no se confirma MPH+: el contenido no se ve, no se enfoca y no se scrollea */
.mx-gate { position: fixed !important; z-index: 5000 !important; }
html.mx-locked, html.mx-locked body { overflow: hidden !important; height: 100%; }
html.mx-locked body > *:not(.mx-gate):not(#mph-topbar):not(.mph-topbar):not(.mx-bar):not(script):not(style) { visibility: hidden !important; }
.mx-gate__loading { display: flex; flex-direction: column; align-items: center; gap: 14px; color: var(--mx-t2); font-size: 15px; }
.mx-gate__spin { width: 30px; height: 30px; border-radius: 50%; border: 2px solid rgba(240, 242, 244, .14); border-top-color: var(--mx-amber); animation: mx-spin .8s linear infinite; }
@keyframes mx-spin { to { transform: rotate(360deg); } }
.mx-gate__card {
  display: none; position: relative; width: 100%; max-width: 560px; text-align: left;
  background: var(--mx-ink-2); border: 1px solid var(--mx-gold); border-radius: 8px;
  padding: clamp(28px, 4vw, 44px); box-shadow: 0 30px 80px rgba(0, 0, 0, .35);
  animation: mx-rise 800ms var(--mx-ease) both;
}
.mx-gate__card::before { content: ''; position: absolute; left: -1px; right: -1px; top: -1px; height: 3px; border-radius: 8px 8px 0 0; background: var(--mx-amber); }
@keyframes mx-rise { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: none; } }
.mx-gate__top { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; }
.mx-gate__eyebrow { font-family: var(--mx-d); font-weight: 700; font-size: 15px; letter-spacing: .16em; text-transform: uppercase; color: var(--mx-amber); }
.mx-gate__t { font-family: var(--mx-d); font-weight: 800; text-transform: uppercase; line-height: .98; font-size: clamp(34px, 5vw, 48px); color: #fff; margin: 0 0 14px; }
.mx-gate__d { font-size: 16.5px; line-height: 1.6; color: var(--mx-t2); margin: 0 0 22px; }
.mx-gate__d strong { color: #fff; font-weight: 600; }
.mx-gate__list { list-style: none; margin: 0 0 26px; padding: 18px 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px 22px; border-top: 1px solid var(--mx-line); border-bottom: 1px solid var(--mx-line); }
.mx-gate__list li { display: flex; align-items: center; gap: 10px; font-size: 15px; color: var(--mx-t1); }
.mx-gate__list li::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--mx-amber); flex: none; }
.mx-gate__ctas { display: flex; flex-wrap: wrap; gap: 12px; }
.mx-gate__note { margin: 20px 0 0; font-size: 14.5px; color: var(--mx-t3); line-height: 1.55; }
.mx-gate__note a { color: #fff; text-underline-offset: 3px; }
.mx-gate__note a:hover { color: var(--mx-amber); }
@media (max-width: 520px) { .mx-gate__list { grid-template-columns: 1fr; } }

/* Botones del sistema de miembro */
.mx-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 48px; padding: 0 24px;
  border-radius: 6px; border: 1.5px solid var(--mx-red); background: var(--mx-red); color: #fff; cursor: pointer;
  font-family: var(--mx-d); font-weight: 700; font-size: 17px; letter-spacing: .07em; text-transform: uppercase; text-decoration: none;
  transition: transform 240ms var(--mx-ease), background-color 180ms, border-color 180ms, color 180ms;
}
.mx-btn:hover { background: #A8202B; border-color: #A8202B; transform: translateY(-2px); }
.mx-btn--ghost { background: transparent; border-color: rgba(240, 242, 244, .42); }
.mx-btn--ghost:hover { background: #fff; border-color: #fff; color: var(--mx-ink); }
.mx-btn:focus-visible, .mx-gate a:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }

/* ═══════════════════════════════════════════════════════════════
   MODO INSTRUMENTO — herramientas oscuras (body.mx-app)
   Se re-tematiza por variables: las herramientas ya usan tokens.
   Sube el contraste de los textos secundarios y unifica el marco.
═══════════════════════════════════════════════════════════════ */
body.mx-app {
  --gray: #9FB0C2; --gray-light: #C3CFDB; --gray-l: #C3CFDB;
  --border-subtle: 1px solid rgba(240, 242, 244, .11);
  --border-line: 1px solid rgba(240, 242, 244, .19);
  --border: 1px solid rgba(240, 242, 244, .11);
  background:
    radial-gradient(1000px 360px at 50% -140px, rgba(204, 41, 54, .12), transparent 72%),
    var(--mx-ink);
  color: var(--mx-t1);
}
body.mx-app .page { max-width: 720px; padding-top: 34px; }
body.mx-app .mx-bar__in { max-width: 800px; }
@media (max-width: 900px) { body.mx-app .mx-status__s { display: none; } }
@media (max-width: 480px) { body.mx-app .tool-header__title, body.mx-app .tool-title { font-size: clamp(32px, 9vw, 40px); } }

/* Encabezado de herramienta — familia grande */
body.mx-app .tool-header {
  position: relative; border-left: 0; padding: 0 0 26px; margin-bottom: 30px; border-bottom: 1px solid var(--mx-line);
}
body.mx-app .tool-header__category { display: none; }
body.mx-app .tool-header__title {
  font-family: var(--mx-d); font-weight: 800; text-transform: uppercase; letter-spacing: .005em;
  font-size: clamp(34px, 6vw, 60px); line-height: .96; color: #fff; margin-bottom: 14px; overflow-wrap: anywhere;
}
body.mx-app .tool-header__sub { font-size: 17px; line-height: 1.55; color: var(--mx-t2); max-width: 56ch; }
body.mx-app .tool-header__badges { margin-top: 18px; }
body.mx-app .badge { font-size: 12.5px; padding: 5px 10px; }
/* Encabezado — familia chica */
body.mx-app .tool-id { display: none; }
body.mx-app .tool-title {
  font-family: var(--mx-d); font-weight: 800; text-transform: uppercase; letter-spacing: .005em;
  font-size: clamp(34px, 6vw, 60px); line-height: .96; color: #fff; margin-bottom: 14px; overflow-wrap: anywhere;
}
body.mx-app .tool-desc { font-size: 17px; line-height: 1.55; color: var(--mx-t2); max-width: 56ch; }
body.mx-app .tool-header { margin-bottom: 30px; }

/* Rótulos y textos auxiliares: nunca menos de 12.5px */
body.mx-app .section-label, body.mx-app .section-title { font-size: 13px; letter-spacing: .12em; }
body.mx-app .context-label { font-size: 14px; }
body.mx-app .disclaimer p, body.mx-app .note-box { font-size: 14px; line-height: 1.6; }
body.mx-app .field__label, body.mx-app .field label { font-size: 15px; }

/* Superficies con marco más nítido */
body.mx-app .card, body.mx-app .section-card { border-color: rgba(240, 242, 244, .13); }

/* Entrada suave de la ficha */
body.mx-app .mx-plate, body.mx-app .tool-header { animation: mx-rise 700ms var(--mx-ease) both; }

/* (bloque reduced-motion retirado) */
body.mx-app .tool-header__id { display: none; }

/* Movimiento: el sitio ya no se apaga con el ajuste «reducir movimiento» del teléfono (muchos Android lo activan con el ahorro de batería y dejaba todo estático). Las animaciones son suaves (fundidos y desplazamientos cortos). */
