/* ============================================================================
   Design Tokens – Colegio Demo
   Paleta: verde pino, terracota, crema y blanco cálido.
   NOTA: por compatibilidad se conservan los NOMBRES de variables (--green-*,
   --yellow-*) usados en todo el sistema por compatibilidad; sus valores siguen
   la identidad de Colegio Demo. Cambiar aquí re-tematiza todo el sistema.
   ========================================================================== */
:root {
    /* Marca Colegio Demo: verde pino */
    --green-900: #12352a;
    --green-800: #1b4332;
    --green-700: #1f4a3a;
    --green-600: #2a5d49;
    --green-500: #3d7a60;
    --green-400: #6b9b82;
    --green-300: #9cbaa8;
    --green-200: #c3d5ca;
    --green-100: #dce8e1;
    --green-50:  #edf4ef;

    --yellow-500: #d4623a;  /* terracota */
    --yellow-400: #e17b54;
    --yellow-300: #f0b09a;

    --black:   #10261e;
    --ink:     #1f4a3a;
    --white:   #ffffff;

    /* Neutros cálidos de papel */
    --gray-900: #1b1930;
    --gray-800: #2a2740;   /* faltaba */
    --gray-700: #423f5c;
    --gray-600: #524f70;   /* faltaba */
    --gray-500: #6a6785;
    --gray-300: #d2cfe2;
    --gray-200: #e8e6f3;
    --gray-100: #f4f2fb;
    --gray-50:  #faf9fe;   /* faltaba */
    --bg:       #f3efe4;

    /* Semánticos */
    --primary:   var(--green-600);
    --primary-d: var(--green-800);
    --accent:    var(--yellow-500);
    --brand-pine: var(--green-800);
    --brand-terra: var(--yellow-500);
    --button-radius: 10px;
    --button-height: 46px;
    --button-shadow: 0 8px 18px rgba(212, 98, 58, .24);
    --text:      var(--gray-900);
    --muted:     var(--gray-500);
    --surface:   var(--white);
    --surface-2: var(--gray-50);   /* superficie elevada / franjas */
    --border:    var(--gray-200);

    /* Tokens de ROL para texto de marca sobre superficie (títulos, enlaces).
       En claro usan verde pino; en oscuro se aclaran.
       Son la clave para el modo oscuro: los componentes usan estos, no --green-*. */
    --ink:        var(--green-800);   /* títulos fuertes */
    --ink-soft:   var(--green-700);   /* subtítulos / enlaces secundarios */
    --brand-link: var(--green-600);   /* enlaces / acentos de marca */

    /* Estados (capa semántica) — usar SIEMPRE estos en vez de inventar el hex.
       Cada estado trae: color sólido (-), fondo suave (-soft) y texto sobre el
       fondo suave (-ink). Sustituye a los ~9 tintes hechos a mano por todo el CSS. */
    --ok:          #1f9d55;  --ok-soft:      #e6f6ec;  --ok-ink:      #0f7a3f;
    --warn:        #c77d0a;  --warn-soft:    #fdf1d8;  --warn-ink:    #8a5300;
    --danger:      #d64545;  --danger-soft:  #fdecec;  --danger-ink:  #a3231f;
    --info:        var(--green-600);  --info-soft: var(--green-50);  --info-ink: var(--green-800);
    --action-edit: #1685c1; /* acción funcional de edición, no color institucional */
    /* Confirmaciones: unifican cabecera, botón, icono del modal e icono del menú Acción. */
    --confirm-success: #00a65a;
    --confirm-warn:    #f39c12;
    --confirm-danger:  #dd4b39;

    /* Modalidad de clase (paleta categórica) — presencial va con texto oscuro. */
    --mod-pres:    #f0a500;  --mod-remoto:  #7c3aed;
    --mod-virtual: #1d72d6;  --mod-hibrido: #d6336c;

    /* Tipografía */
    --font-sans: 'Inter', 'Segoe UI', system-ui, -apple-system, Arial, sans-serif;
    --font-head: 'Poppins', var(--font-sans);

    /* Radios y sombras */
    --r-sm: 8px;
    --r-md: 14px;
    --r-lg: 22px;
    --r-xl: 32px;
    --shadow-sm: 0 2px 8px rgba(31, 74, 58, .07);
    --shadow-md: 0 10px 30px rgba(31, 74, 58, .12);
    --shadow-lg: 0 24px 60px rgba(31, 74, 58, .20);

    /* Layout */
    --container: 1200px;
    --gutter: 24px;
    --nav-h: 76px;

    /* Transiciones */
    --t-fast: .18s ease;
    --t: .32s cubic-bezier(.4, 0, .2, 1);
}

/* ============================================================================
   MODO OSCURO (v1) — solo el APP (portal / aula / admin / acceso), NO el sitio
   público (que aún no está tokenizado). Se activa con la preferencia del SO.
   Solo se redefinen TOKENS; los componentes no se tocan. La marca sólida
   (--green-300…900) se conserva (sirve de fondo oscuro con texto blanco); solo
   se aclaran los tokens de rol/texto y se oscurecen superficies y tintes.
   Doble regla: automático por preferencia y manual con [data-theme].
   ========================================================================== */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) body.portal,
  :root:not([data-theme="light"]) body.auth-body { color-scheme: dark;
    /* Neutros invertidos */
    --bg:        #101a16;
    --surface:   #17241e;
    --surface-2: #203128;
    --gray-50:   #142019;
    --gray-100:  #17241e;
    --gray-200:  #2b4035;
    --gray-300:  #3d5548;
    --gray-500:  #9bb3a5;
    --gray-600:  #b3c7bb;
    --gray-700:  #c9d8cf;
    --gray-800:  #e0e9e3;
    --gray-900:  #f1f6f2;
    --text:      #f1f6f2;
    --muted:     #9bb3a5;
    --border:    #2b4035;
    /* Tintes de marca claros -> oscuros (fondos de chip/hover) */
    --green-50:  #203128;
    --green-100: #294036;
    --green-200: #355244;
    /* Tokens de rol de texto: ahora CLAROS */
    --ink:        #edf5ef;
    --ink-soft:   #c9dacf;
    --brand-link: #8fc5a7;
    --primary:    var(--green-400);   /* enlaces/acentos de marca más brillantes */
    /* Estados: fondo suave oscuro + texto claro (los sólidos se conservan) */
    --ok-soft:     #12291c;  --ok-ink:     #63d597;
    --warn-soft:   #2c2410;  --warn-ink:   #ffc659;
    --danger-soft: #2e1620;  --danger-ink: #ff8f8f;
    --info-soft:   #203128;  --info-ink:   #b5e0c5;
    --action-edit: #63b3ed;
    /* Sombras más marcadas sobre fondo oscuro */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, .40);
    --shadow-md: 0 10px 30px rgba(0, 0, 0, .45);
    --shadow-lg: 0 24px 60px rgba(0, 0, 0, .55);
  }
}
/* Conmutación manual con el toggle: [data-theme] va en <html> (:root). Aplica a
   TODO body (app + sitio público) — el toggle es explícito, el visitante lo pidió. */
:root[data-theme="dark"] body { color-scheme: dark;
    --bg:#101a16; --surface:#17241e; --surface-2:#203128;
    --gray-50:#142019; --gray-100:#17241e; --gray-200:#2b4035; --gray-300:#3d5548;
    --gray-500:#9bb3a5; --gray-600:#b3c7bb; --gray-700:#c9d8cf; --gray-800:#e0e9e3; --gray-900:#f1f6f2;
    --text:#f1f6f2; --muted:#9bb3a5; --border:#2b4035;
    --green-50:#203128; --green-100:#294036; --green-200:#355244;
    --ink:#edf5ef; --ink-soft:#c9dacf; --brand-link:#8fc5a7; --primary:var(--green-400);
    --ok-soft:#12291c; --ok-ink:#63d597; --warn-soft:#2c2410; --warn-ink:#ffc659;
    --danger-soft:#2e1620; --danger-ink:#ff8f8f; --info-soft:#203128; --info-ink:#b5e0c5;
    --action-edit:#63b3ed;
    --shadow-sm:0 2px 8px rgba(0,0,0,.40); --shadow-md:0 10px 30px rgba(0,0,0,.45); --shadow-lg:0 24px 60px rgba(0,0,0,.55);
}
