/* MComSuite UI 2026 — capa de componentes compartida.
   Botones, marcas de pago y estados de interacción. Se carga en todas las páginas.
   Reglas globales con :where() (especificidad 0) para no pisar estilos de cada página. */

:root {
  --ns-bg: #070b12;
  --ns-surface: #0d1422;
  --ns-surface-2: #111b2e;
  --ns-line: rgba(148, 163, 184, .18);
  --ns-line-strong: rgba(148, 163, 184, .34);
  --ns-text: #f8fafc;
  --ns-muted: #94a3b8;
  --ns-accent: #38bdf8;
  --ns-accent-deep: #0284c7;
  --ns-gold: #d4af37;
  --ns-green: #34d399;
  --ns-rose: #fb7185;
  --ns-radius: 10px;
  --ns-ring: 0 0 0 3px rgba(56, 189, 248, .32);
  --ns-shadow: 0 14px 34px -22px rgba(0, 0, 0, .95);
}

/* ---------- Interacción global, sin cambiar la identidad de cada página ---------- */

:where(button, a.btn, [role="button"], input[type="button"], input[type="submit"]) {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

:where(button, a.btn, [role="button"], input[type="button"], input[type="submit"]):focus-visible {
  outline: 2px solid var(--ns-accent);
  outline-offset: 2px;
}

:where(button, a.btn, [role="button"]):disabled,
:where([aria-disabled="true"]) {
  cursor: not-allowed;
}

:where(a):focus-visible {
  outline: 2px solid var(--ns-accent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---------- Botón base ---------- */

.ns-btn {
  --ns-btn-bg: rgba(255, 255, 255, .045);
  --ns-btn-ink: #e2e8f0;
  --ns-btn-border: var(--ns-line-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .55rem;
  min-height: 46px;
  padding: 0 18px;
  border: 1px solid var(--ns-btn-border);
  border-radius: var(--ns-radius);
  background: var(--ns-btn-bg);
  color: var(--ns-btn-ink);
  font-family: inherit;
  font-size: .85rem;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: .005em;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: var(--ns-shadow);
  transition: background-color .16s ease, border-color .16s ease, color .16s ease,
    box-shadow .16s ease, transform .12s ease;
}

.ns-btn:hover { border-color: rgba(56, 189, 248, .42); background: rgba(56, 189, 248, .09); }
.ns-btn:active { transform: translateY(1px); }

.ns-btn:disabled,
.ns-btn[aria-disabled="true"] {
  opacity: .45;
  box-shadow: none;
  transform: none;
  pointer-events: none;
}

.ns-btn[aria-busy="true"] { pointer-events: none; }

.ns-btn svg,
.ns-btn__icon { width: 17px; height: 17px; flex: 0 0 auto; }

/* ---------- Variantes ---------- */

.ns-btn--primary {
  --ns-btn-bg: linear-gradient(180deg, #0ea5e9, var(--ns-accent-deep));
  --ns-btn-ink: #f0f9ff;
  --ns-btn-border: #0891d1;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22), 0 12px 26px -18px rgba(14, 165, 233, .9);
}

.ns-btn--primary:hover {
  background: linear-gradient(180deg, #22b4f0, #0788c6);
  border-color: #38bdf8;
}

.ns-btn--secondary {
  --ns-btn-bg: rgba(255, 255, 255, .05);
  --ns-btn-border: var(--ns-line-strong);
}

.ns-btn--ghost {
  --ns-btn-bg: transparent;
  --ns-btn-border: transparent;
  --ns-btn-ink: #cbd5e1;
  box-shadow: none;
}

.ns-btn--ghost:hover { background: rgba(255, 255, 255, .05); border-color: var(--ns-line); }

.ns-btn--success {
  --ns-btn-bg: rgba(52, 211, 153, .14);
  --ns-btn-ink: #a7f3d0;
  --ns-btn-border: rgba(52, 211, 153, .42);
  box-shadow: none;
}

.ns-btn--success:hover { background: rgba(52, 211, 153, .2); border-color: rgba(52, 211, 153, .6); }

.ns-btn--danger {
  --ns-btn-bg: rgba(251, 113, 133, .12);
  --ns-btn-ink: #fecdd3;
  --ns-btn-border: rgba(251, 113, 133, .42);
  box-shadow: none;
}

.ns-btn--danger:hover { background: rgba(251, 113, 133, .18); border-color: rgba(251, 113, 133, .62); }

.ns-btn--whatsapp {
  --ns-btn-bg: rgba(37, 211, 102, .13);
  --ns-btn-ink: #bbf7d0;
  --ns-btn-border: rgba(37, 211, 102, .38);
  box-shadow: none;
}

.ns-btn--whatsapp:hover { background: rgba(37, 211, 102, .19); border-color: rgba(37, 211, 102, .56); }

/* Botón oficial de PayPal: oro de marca #FFC439, tinta #003087, forma píldora. */
.ns-btn--paypal {
  --ns-btn-bg: #ffc439;
  --ns-btn-ink: #003087;
  --ns-btn-border: rgba(0, 0, 0, .08);
  min-height: 50px;
  padding: 0 26px;
  border-radius: 999px;
  font-size: .95rem;
  font-weight: 700;
  letter-spacing: .002em;
  box-shadow: 0 10px 24px -16px rgba(255, 196, 57, .85);
}

.ns-btn--paypal:hover { background: #f7ba33; border-color: rgba(0, 0, 0, .14); }
.ns-btn--paypal:active { background: #edaf28; }

.ns-btn--paypal:focus-visible {
  outline: 3px solid #0070ba;
  outline-offset: 3px;
}

.ns-btn--paypal .ns-paypal-mark { height: 20px; width: auto; display: block; }

/* ---------- Tamaños y disposición ---------- */

.ns-btn--sm { min-height: 36px; padding: 0 12px; font-size: .77rem; border-radius: 8px; }
.ns-btn--lg { min-height: 54px; padding: 0 26px; font-size: .95rem; }
.ns-btn--block { width: 100%; }
.ns-btn--pill { border-radius: 999px; }

.ns-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.ns-actions--stack { flex-direction: column; align-items: stretch; }
.ns-actions--stack .ns-btn { width: 100%; }

/* ---------- Spinner de estado ---------- */

.ns-spinner {
  width: 15px;
  height: 15px;
  flex: 0 0 15px;
  border: 2px solid rgba(0, 0, 0, .22);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: ns-spin .7s linear infinite;
}

.ns-btn--primary .ns-spinner,
.ns-btn--secondary .ns-spinner,
.ns-btn--success .ns-spinner { border-color: rgba(255, 255, 255, .28); border-top-color: currentColor; }

@keyframes ns-spin { to { transform: rotate(360deg); } }

/* ---------- Confianza y marcas de pago ---------- */

.ns-trust {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  font-size: .74rem;
  line-height: 1.4;
  color: var(--ns-muted);
}

.ns-trust__lock {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  color: var(--ns-green);
}

.ns-paymarks { display: flex; align-items: center; gap: 6px; margin-left: auto; }

.ns-paymark {
  height: 24px;
  min-width: 38px;
  padding: 0 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  border: 1px solid rgba(148, 163, 184, .25);
  border-radius: 5px;
  background: #fff;
  box-sizing: border-box;
}

.ns-paymark img { height: 15px; width: auto; display: block; }
.ns-paymark--visa { color: #1a1f71; font: italic 800 11px/1 'Segoe UI', system-ui, sans-serif; letter-spacing: .02em; }
.ns-paymark--amex { background: #1f72cd; border-color: #1f72cd; color: #fff; font: 800 9px/1 'Segoe UI', system-ui, sans-serif; letter-spacing: .06em; }
.ns-paymark--mc i { width: 12px; height: 12px; border-radius: 50%; display: block; }
.ns-paymark--mc i:first-child { background: #eb001b; }
.ns-paymark--mc i:last-child { background: #f79e1b; margin-left: -5px; mix-blend-mode: multiply; }

/* ---------- Avisos de estado ---------- */

.ns-alert {
  border: 1px solid var(--ns-line);
  border-radius: var(--ns-radius);
  padding: 12px 14px;
  background: rgba(7, 11, 18, .62);
  color: #cbd5e1;
  font-size: .82rem;
  line-height: 1.55;
}

.ns-alert[data-tone="ok"] { border-color: rgba(52, 211, 153, .38); background: rgba(52, 211, 153, .08); color: #a7f3d0; }
.ns-alert[data-tone="warn"] { border-color: rgba(251, 191, 36, .38); background: rgba(251, 191, 36, .08); color: #fde68a; }
.ns-alert[data-tone="error"] { border-color: rgba(251, 113, 133, .42); background: rgba(251, 113, 133, .08); color: #fecdd3; }

@media (prefers-reduced-motion: reduce) {
  .ns-btn { transition: none; }
  .ns-spinner { animation: none; border-top-color: transparent; }
}

/* ---------- Scrollbars unificados para las páginas del portal ---------- */

html {
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, 0.38) transparent;
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.3);
  border: 3px solid transparent;
  background-clip: padding-box;
  border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(148, 163, 184, 0.5);
  border: 2px solid transparent;
  background-clip: padding-box;
}

::-webkit-scrollbar-corner {
  background: transparent;
}

.ns-table-scroll,
.sovereign-modal-body {
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

/* ---------- Liquid Glassmorphism 2026 · Ventanas, Cuadros y Paneles ---------- */

:root {
  --lg-blur: blur(22px) saturate(175%);
  --lg-bg: linear-gradient(148deg, rgba(255, 255, 255, 0.095), rgba(15, 23, 42, 0.58) 54%, rgba(6, 10, 20, 0.82));
  --lg-bg-hover: linear-gradient(148deg, rgba(255, 255, 255, 0.14), rgba(20, 32, 54, 0.66) 54%, rgba(9, 14, 28, 0.88));
  --lg-border: rgba(255, 255, 255, 0.16);
  --lg-border-hi: rgba(125, 211, 252, 0.44);
  --lg-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.24),
    inset 0 -1px 0 rgba(255, 255, 255, 0.06),
    0 22px 48px -22px rgba(0, 0, 0, 0.82);
}

.mcom-glass-card,
.glass-panel {
  background: var(--lg-bg);
  backdrop-filter: var(--lg-blur);
  -webkit-backdrop-filter: var(--lg-blur);
  border: 1px solid var(--lg-border);
  border-radius: 18px;
  box-shadow: var(--lg-shadow);
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.22s ease, box-shadow 0.22s ease, background 0.22s ease;
}

.mcom-glass-card:hover {
  background: var(--lg-bg-hover);
  border-color: var(--lg-border-hi);
  transform: translateY(-2px);
}

.mcom-glass-window {
  background: linear-gradient(155deg, rgba(255, 255, 255, 0.085), rgba(12, 18, 32, 0.72) 48%, rgba(5, 8, 16, 0.88));
  backdrop-filter: blur(26px) saturate(185%);
  -webkit-backdrop-filter: blur(26px) saturate(185%);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 20px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    inset 0 -1px 0 rgba(255, 255, 255, 0.05),
    0 28px 64px -26px rgba(0, 0, 0, 0.88);
  overflow: hidden;
}

.mcom-window-chrome {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.02));
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.mcom-window-dots {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.mcom-window-dots i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: block;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.45);
}

.mcom-window-dots i:nth-child(1) { background: rgba(251, 113, 133, 0.88); }
.mcom-window-dots i:nth-child(2) { background: rgba(251, 191, 36, 0.88); }
.mcom-window-dots i:nth-child(3) { background: rgba(52, 211, 153, 0.88); }

.mcom-glass-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.04));
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

@media (max-width: 1023px) {
  .mcom-glass-card,
  .mcom-glass-window,
  .mcom-glass-pill {
    backdrop-filter: blur(10px) saturate(135%);
    -webkit-backdrop-filter: blur(10px) saturate(135%);
  }
}
