/* ============================================================================
   TEMA ORIÓN · generado desde config/estilos_orion.php
   No edites este archivo: cambia los valores en esa configuración.
   ============================================================================ */

:root {
  /* Fondos */
  --o-bg: radial-gradient(980px 560px at 14% 12%, rgba(77, 124, 15, 0.30), transparent 58%),radial-gradient(760px 440px at 86% 14%, rgba(249, 115, 22, 0.10), transparent 58%),radial-gradient(800px 520px at 50% 100%, rgba(63, 98, 18, 0.22), transparent 60%), linear-gradient(160deg, #0C100A 0%, #141A10 100%);
  --o-surface-1: #141A11;
  --o-surface-2: #1C2418;
  --o-surface-3: #252F20;

  /* Canales sueltos, para escribir rgba(var(--o-fg-rgb), .12) en las
     pantallas. fg = el color "de primer plano" (blanco en oscuro), shade = el
     velo que oscurece (negro en oscuro), s1 = la superficie de las tarjetas.
     En modo claro se invierten, y así cada rgba se adapta solo. */
  --o-fg-rgb: 255, 255, 255;
  --o-shade-rgb: 0, 0, 0;
  --o-s1-rgb: 20, 26, 17;

  /* Texto */
  --o-text: #F3F6EE;
  --o-text-soft: #D2DBC8;
  --o-text-muted: #9DAA92;
  --o-ink: #0C100A;

  /* Marca */
  --o-brand: #4D7C0F;
  --o-brand-soft: #84CC16;
  --o-accent: #F97316;
  --o-accent-soft: #FDBA74;

  /* Estados */
  --o-ok: #3FDE9C;
  --o-ok-bg: rgba(63, 222, 156, 0.14);
  --o-ok-border: rgba(63, 222, 156, 0.4);

  --o-danger: #FF6B85;
  --o-danger-bg: rgba(255, 107, 133, 0.14);
  --o-danger-border: rgba(255, 107, 133, 0.4);

  --o-frozen: #7DD3FC;
  --o-frozen-bg: rgba(125, 211, 252, 0.14);
  --o-frozen-border: rgba(125, 211, 252, 0.4);

  --o-warn: #FBBF24;
  --o-warn-bg: rgba(251, 191, 36, 0.14);
  --o-warn-border: rgba(251, 191, 36, 0.4);

  --o-info: #93C5FD;
  --o-info-bg: rgba(147, 197, 253, 0.14);
  --o-info-border: rgba(147, 197, 253, 0.4);

  --o-highlight: #FFD60A;

  /* Categoría de deportista */
  --o-adulto: #60A5FA;
  --o-adulto-bg: rgba(96, 165, 250, 0.18);
  --o-menor: #F472B6;
  --o-menor-bg: rgba(244, 114, 182, 0.18);

  /* Bordes */
  --o-border: rgba(210, 219, 200, 0.14);
  --o-border-strong: rgba(210, 219, 200, 0.26);
  --o-divider: rgba(210, 219, 200, 0.10);

  /* Forma y profundidad */
  --o-radius: 18px;
  --o-radius-sm: 12px;
  --o-radius-lg: 24px;
  --o-radius-pill: 999px;
  --o-shadow-sm: 0 6px 16px rgba(0, 0, 0, 0.28);
  --o-shadow: 0 14px 34px rgba(0, 0, 0, 0.34);
  --o-shadow-lg: 0 26px 60px rgba(0, 0, 0, 0.44);
  --o-focus-ring: 0 0 0 3px rgba(249, 115, 22, 0.4);

  /* Tipografía */
  --o-font-titulos: 'Bebas Neue', 'Bebas Neue', system-ui, sans-serif;
  --o-font-texto: 'Poppins', Poppins, system-ui, sans-serif;

  /* ------------------------------------------------------------------
     Puente con el CSS antiguo. global.css fue escrito antes que este
     sistema y usa sus propios nombres; aquí se reapuntan para que todo
     cambie desde un solo sitio. No borrar.
     ------------------------------------------------------------------ */
  --primary: var(--o-brand);
  --primary-2: var(--o-brand-soft);
  --accent: var(--o-accent);
  --bg-0: #141A11;
  --bg-1: #141A11;
  --surface: var(--o-surface-1);
  --surface-2: var(--o-surface-2);
  --stroke: var(--o-border);
  --stroke-strong: var(--o-border-strong);
  --text: var(--o-text);
  --muted: var(--o-text-muted);
  --text-dark: var(--o-ink);
  --radius: var(--o-radius);
  --radius-sm: var(--o-radius-sm);
  --shadow: var(--o-shadow-lg);
  --shadow-soft: var(--o-shadow);
}


/* ============================================================================
   AJUSTES BASE
   Correcciones de legibilidad para todo el sistema. No se inventan colores
   nuevos: solo se usan los tokens de arriba.
   ============================================================================ */

/* El !important es a propósito: esta hoja es la autoridad del tema y tiene
   que ganar a cualquier fondo que haya quedado escrito a mano en otra parte.
   Sin él, un !important perdido en global.css dejaba el fondo congelado y
   cambiar el color en el panel no hacía nada. */
body,
body.orion-app {
  background: var(--o-bg) !important;
  background-repeat: no-repeat !important;
  background-size: cover !important;
  background-attachment: fixed !important;
  background-position: center center !important;
  color: var(--o-text);
  font-family: var(--o-font-texto);
}

h1, h2, h3, h4, h5, h6,
.page-title-orion,
.modal-title {
  font-family: var(--o-font-titulos);
}

/* Bootstrap apaga estos textos hasta hacerlos ilegibles sobre fondo oscuro:
   .text-white-50 es blanco al 50% y .form-text es gris OSCURO, pensado para
   fondo claro. Los tres se reasignan al nivel apagado del tema. */
.text-white-50,
.text-muted,
.orion-muted,
.form-text {
  color: var(--o-text-muted) !important;
}

/* Foco visible con teclado. Solo el anillo: la forma del elemento no se toca,
   porque cambiarla al enfocar hace que los botones salten. */
:where(a, button, input, select, textarea, [tabindex]):focus-visible {
  outline: none;
  box-shadow: var(--o-focus-ring);
}

/* ============================================================================
   MODO CLARO · calculado de la paleta en uso
   ============================================================================ */
html[data-modo="claro"] {
  color-scheme: light;
  --o-fg-rgb: 12, 16, 10;
  --o-shade-rgb: 255, 255, 255;
  --o-s1-rgb: 255, 255, 255;
  --o-bg: radial-gradient(980px 560px at 14% 12%, rgba(77, 124, 15, 0.1), transparent 58%), radial-gradient(760px 440px at 86% 14%, rgba(249, 115, 22, 0.08), transparent 58%), linear-gradient(160deg, #f4f7f1 0%, #fff5ef 100%);
  --o-surface-1: #ffffff;
  --o-surface-2: #f5f5f5;
  --o-surface-3: #ececeb;
  --o-text: #0C100A;
  --o-text-soft: #414540;
  --o-text-muted: #6d706c;
  --o-ink: #0C100A;
  --o-brand: #41690d;
  --o-brand-soft: #639911;
  --o-accent: #ae510f;
  --o-accent-soft: #a4794b;
  --o-ok: #237a56; --o-ok-bg: rgba(63, 222, 156, 0.14); --o-ok-border: rgba(35, 122, 86, 0.4);
  --o-danger: #8c3b49; --o-danger-bg: rgba(255, 107, 133, 0.14); --o-danger-border: rgba(140, 59, 73, 0.4);
  --o-frozen: #45748b; --o-frozen-bg: rgba(125, 211, 252, 0.14); --o-frozen-border: rgba(69, 116, 139, 0.4);
  --o-warn: #8a6914; --o-warn-bg: rgba(251, 191, 36, 0.14); --o-warn-border: rgba(138, 105, 20, 0.4);
  --o-info: #516c8b; --o-info-bg: rgba(147, 197, 253, 0.14); --o-info-border: rgba(81, 108, 139, 0.4);
  --o-highlight: #998006;
  --o-adulto: #4374af;
  --o-menor: #ab507f;
  --o-border: rgba(12, 16, 10, 0.14);
  --o-border-strong: rgba(12, 16, 10, 0.26);
  --o-divider: rgba(12, 16, 10, 0.09);
  --o-shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.06);
  --o-shadow: 0 10px 26px rgba(0, 0, 0, 0.08);
  --o-shadow-lg: 0 20px 48px rgba(0, 0, 0, 0.12);
  --bg-0: #ffffff;
  --bg-1: #ffffff;
}

/* Bootstrap trae clases pensadas para fondo oscuro que en claro dejan el
   texto blanco sobre blanco. Se reapuntan al tema. */
html[data-modo="claro"] .text-white,
html[data-modo="claro"] .text-light {
  color: var(--o-text) !important;
}

html[data-modo="claro"] .text-bg-dark,
html[data-modo="claro"] .bg-dark {
  background-color: var(--o-surface-1) !important;
  color: var(--o-text) !important;
}

html[data-modo="claro"] .btn-close-white {
  filter: none;
}

html[data-modo="claro"] .btn-outline-light {
  color: var(--o-text);
  border-color: var(--o-border-strong);
}

html[data-modo="claro"] .btn-outline-light:hover {
  background: var(--o-surface-3);
  color: var(--o-text);
}

/* global.css escribe a mano algunos colores pensados para fondo oscuro */
html[data-modo="claro"] .page-title-orion {
  color: var(--o-text);
  text-shadow: none;
}

html[data-modo="claro"] .dropdown-menu,
html[data-modo="claro"] .dropdown-menu-dark {
  --bs-dropdown-bg: var(--o-surface-1);
  --bs-dropdown-color: var(--o-text);
  --bs-dropdown-link-color: var(--o-text-soft);
  --bs-dropdown-link-hover-color: var(--o-text);
  --bs-dropdown-link-hover-bg: var(--o-surface-3);
  background: var(--o-surface-1);
}

html[data-modo="claro"] .search-orion {
  background: var(--o-surface-1) !important;
  border-color: var(--o-border-strong) !important;
}

html[data-modo="claro"] .search-orion::placeholder {
  color: var(--o-text-muted);
}

/* Ventanas de SweetAlert: varias pantallas les pasan fondo y texto oscuros
   fijos desde JavaScript, en línea. !important gana a ese estilo en línea. */
html[data-modo="claro"] .swal2-popup {
  background: var(--o-surface-1) !important;
  color: var(--o-text) !important;
}

html[data-modo="claro"] .swal2-title,
html[data-modo="claro"] .swal2-html-container {
  color: var(--o-text) !important;
}

/* Etiquetas .badge con fondo propio (translúcido) y sin clase bg-*: Bootstrap
   les pone texto blanco, que sobre un fondo claro no se lee. */
html[data-modo="claro"] .badge:not([class*="bg-"]) {
  color: var(--o-text);
}

html[data-modo="claro"] .modal-content {
  background-color: var(--o-surface-1);
  color: var(--o-text);
}

html[data-modo="claro"] .navbar-dark .navbar-toggler-icon {
  filter: invert(1);
}

html[data-modo="claro"] .table-dark {
  --bs-table-bg: var(--o-surface-1);
  --bs-table-color: var(--o-text);
  --bs-table-border-color: var(--o-border);
  --bs-table-striped-bg: var(--o-surface-2);
  --bs-table-hover-bg: var(--o-surface-3);
}

/* Respeta a quien pide menos animación en su sistema operativo */
@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}