/* Identidad de relojchecador, compartida por la portada, el inicio de
   sesión, el portal y «Mi Holaboral». Aquí vive la paleta: es el único lugar
   donde se escriben colores literales; las demás hojas usan las variables.

   Papel cálido y tinta profunda como neutros; lima como marcador de lo que
   espera una acción (nunca como fondo de pantallas de trabajo); cuatro
   semánticos (correcto, advertencia, error, información), cada uno con su
   tono de texto y su fondo suave. Inter para decir, Instrument Serif itálica
   para subrayar una o dos palabras, monoespaciada solo para cifras en
   columna e identificadores. Es clara siempre: no sigue el modo oscuro del
   sistema. Se activa con la clase .brand en <body>.

   Contraste (WCAG 2.1, comprobado por cálculo): --text, --text-2 y los
   semánticos ≥ 4.5:1 sobre --paper, --surface y --surface-2; --text-3
   ≥ 4.5:1 sobre esos mismos tres; cada semántico ≥ 4.5:1 sobre su fondo
   suave; --ink sobre --lime 14.6:1. --surface-3 es solo para planos sin
   texto secundario. */

:root:has(.brand) {
  color-scheme: light;

  /* ── Marca ── */
  --paper: #f5f5f7;        /* fondo de página: papel con temperatura sutil */
  --ink: #11120d;          /* tinta: texto, botón principal, piezas oscuras */
  --ink-2: #1e1f19;        /* superficie elevada sobre tinta */
  --lime: #c8f24f;         /* marcador: lo que espera una acción */
  --lime-strong: #b5e12f;  /* lima presionada o bajo el cursor */
  --lime-soft: #eef8cf;    /* fondo suave de un pendiente */
  --lime-ink: #3f5400;     /* texto sobre --lime-soft o sobre papel */

  /* ── Neutros ── */
  --bg: var(--paper);
  --surface: #ffffff;      /* tarjetas, listas, campos */
  --surface-2: #ebebef;    /* banda o tarjeta hundida */
  --surface-3: #dedee3;    /* plano decorativo más profundo (sin texto secundario) */
  --text: var(--ink);
  --text-2: #4f4f55;       /* texto secundario */
  --text-3: #6e6e73;       /* texto terciario, notas */
  --line: rgba(17, 18, 13, 0.14);         /* separadores y bordes */
  --line-soft: rgba(17, 18, 13, 0.08);    /* separadores dentro de una superficie */
  --line-strong: rgba(17, 18, 13, 0.5);   /* borde de control que debe verse (3:1) */
  --fill: rgba(17, 18, 13, 0.05);         /* relleno de control en reposo */
  --fill-press: rgba(17, 18, 13, 0.1);    /* relleno presionado */

  /* ── Acción ── */
  --accent: var(--ink);
  --accent-text: var(--ink);
  --on-accent: var(--paper);
  --focus: var(--lime);    /* halo de foco, siempre junto a un borde de tinta */

  /* ── Semánticos: texto / fondo suave / relleno de gráfica ── */
  --ok: #1a7439;           --ok-soft: #e1f1e4;
  --double: #955000;       --double-fill: #f0a02a;
  --warn: var(--double);   --warn-soft: #fbecd2;
  --triple: #bd2a16;
  --danger: var(--triple); --danger-soft: #fbe4df;
  --info: #2554c0;         --info-soft: #e4eafb;

  /* ── Materiales y sombras ── */
  --chrome: rgba(255, 255, 255, 0.78);
  --scrim: rgba(17, 18, 13, 0.36);
  --shadow-1: 0 1px 2px rgba(17, 18, 13, 0.06), 0 2px 8px rgba(17, 18, 13, 0.04);
  --shadow-2: 0 2px 4px rgba(17, 18, 13, 0.05), 0 12px 32px rgba(17, 18, 13, 0.09);
  --shadow-sheet: 0 24px 80px rgba(17, 18, 13, 0.24), 0 2px 8px rgba(17, 18, 13, 0.08);
}

/* Piezas de tinta: la regla, el cierre, el panel lateral del acceso. */
.on-ink {
  --surface: var(--ink-2);
  --text: var(--paper);
  --text-2: rgba(255, 255, 255, 0.72);
  --text-3: rgba(255, 255, 255, 0.56);
  --line: rgba(255, 255, 255, 0.16);
  --line-soft: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.5);
  --fill: rgba(255, 255, 255, 0.08);
  --fill-press: rgba(255, 255, 255, 0.15);
  --accent: var(--lime);
  --accent-text: var(--lime);
  --on-accent: var(--ink);
  --ok: #74d98f;
  --double: #ffb547;
  --double-fill: #ffa51f;
  --triple: #ff806c;
  --info: #93b3ff;
  background: var(--ink);
  color: var(--text);
}

/* ── Tipografía ──
   Inter variable con eje óptico: el corte de titulares entra solo al crecer.
   El tracking baja con el tamaño y el interlineado se aprieta; el texto
   corrido queda en 0. La jerarquía sale de peso + tamaño + interlineado. */
.brand h1, .brand h2, .brand h3 { font-family: var(--display); font-optical-sizing: auto; }
.mega { font-size: clamp(2.75rem, 6.6vw, 5.75rem); line-height: 0.98; letter-spacing: -0.042em; font-weight: 600; text-wrap: balance; }
.huge { font-size: clamp(2.125rem, 4.6vw, 3.75rem); line-height: 1.03; letter-spacing: -0.036em; font-weight: 600; text-wrap: balance; }
.big { font-size: clamp(1.5rem, 2.4vw, 2rem); line-height: 1.12; letter-spacing: -0.028em; font-weight: 600; text-wrap: balance; }

/* El rótulo sobre un título ya no grita: texto normal, sin mayúsculas ni
   monoespaciada. Como mucho uno por pantalla y solo si aporta un dato. */
.brand .eyebrow { font-family: var(--sans); font-size: 0.875rem; line-height: 1.4; font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--text-2); }
.brand .eyebrow i { font-style: normal; color: var(--text-3); margin: 0 0.5em; }

/* Una sola familia. La frase de acento de un titular baja a gris. */
.brand em { font-family: inherit; font-style: normal; font-weight: inherit; letter-spacing: inherit; font-size: 1em; line-height: inherit; color: var(--text-3); }
.brand .on-ink em { color: var(--text-2); }

/* Marcador lima: una pasada baja bajo la palabra sobre papel; sobre tinta,
   la palabra misma toma el color. */
.hl { position: relative; display: inline-block; isolation: isolate; padding: 0 0.06em; margin: 0 -0.06em; }
.hl::before { content: ""; position: absolute; z-index: -1; left: 0; right: 0; bottom: 0.1em; height: 0.3em; border-radius: 0.06em; background: var(--lime); transform-origin: left center; }
.on-ink .hl { color: var(--lime); }
.on-ink .hl::before { content: none; }

/* ── Marca ── */
.logo { display: inline-flex; align-items: center; gap: 9px; color: var(--text); }
.logo .mark { width: 24px; height: 24px; flex: none; }
.logo .word { font-family: var(--display); font-size: 1.0625rem; font-weight: 400; letter-spacing: -0.025em; }
.logo .word b { font-weight: 680; }

/* ── Botones: un principal de tinta por pantalla. Responden al presionar. ── */
.brand .btn { border-radius: 12px; font-weight: 550; letter-spacing: -0.006em; }
.brand .btn.primary { background: var(--accent); color: var(--on-accent); }
.brand .btn.primary:active { background: color-mix(in srgb, var(--accent) 84%, var(--on-accent)); }
.brand .btn.ghost { background: none; box-shadow: inset 0 0 0 1px var(--line-strong); }
.brand .btn.ghost:active { background: var(--fill); }
.btn.go::after { content: ""; width: 0.95em; height: 0.95em; flex: none; background: currentColor; transition: transform var(--t-ui) var(--ease-out);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23000' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2.5 8h11M9 3.5 13.5 8 9 12.5'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23000' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2.5 8h11M9 3.5 13.5 8 9 12.5'/%3E%3C/svg%3E") center / contain no-repeat; }
@media (hover: hover) and (pointer: fine) {
  .brand .btn.primary:hover:not(:active) { background: color-mix(in srgb, var(--accent) 88%, var(--on-accent)); }
  .brand .btn.ghost:hover:not(:active) { background: var(--fill); }
  .btn.go:hover::after { transform: translateX(3px); }
}
@media (prefers-reduced-motion: reduce) { .btn.go::after { transition: none; } }

/* ── Etiquetas semánticas adicionales (las base viven en app.css) ── */
.brand .tag.wait { color: var(--ink); background: var(--lime); }

/* Páginas de presentación (portada, acceso, demostración): fondo blanco. Las
   pantallas de trabajo (portal, «Mi Holaboral», quiosco) usan el gris claro de
   --paper con superficies blancas encima. */
:root:has(.landing), :root:has(.auth) { --paper: #ffffff; --surface-2: #f5f5f7; --surface-3: #e8e8ed; --chrome: rgba(255, 255, 255, 0.8); }
.brand .hl { padding: 0; margin: 0; }
.brand .hl::before { content: none; }

/* ── La marca: una h en ficha de tinta con un punto lima (la «i» de «hi»: un
   saludo). Sobre tinta se invierte: ficha lima, letra y punto en tinta. ── */
.m-tile { fill: var(--ink); }
.m-h { fill: none; stroke: #fff; stroke-width: 3.1; stroke-linecap: round; stroke-linejoin: round; }
.m-dot { fill: var(--lime); }
.on-ink .m-tile { fill: var(--lime); }
.on-ink .m-h { stroke: var(--ink); }
.on-ink .m-dot { fill: var(--ink); }
.logo .mark { width: 26px; height: 26px; }

/* ══ Lenguaje «píldora» (propuesta aprobada el 29 nov 2026) ══════════════════
   Mismos colores; cambia la forma. Superficies muy redondeadas, controles en
   píldora, cifras grandes y delgadas, una pieza de tinta con la acción lima
   para lo importante del momento, y barras con el tramo pendiente rayado.
   Estas piezas son comunes a la portada, el portal, «Mi Holaboral» y el quiosco. */
:root:has(.brand) { --radius: 28px; --radius-s: 18px; --radius-pill: 999px; --hatch: repeating-linear-gradient(-45deg, #cfcfd4 0 3px, transparent 3px 7px); }
.brand .btn { border-radius: var(--radius-pill); }
.brand .input, .brand select.input { border-radius: 16px; }
.brand textarea.input { border-radius: 18px; }
.brand .tag { height: 28px; padding: 0 12px; font-size: 0.8125rem; }

/* Cifra protagonista: grande y delgada; la parte menor (minutos, «de 14») en gris. */
.figure { font-size: clamp(3.5rem, 9vw, 5.25rem); line-height: 1; font-weight: 300; letter-spacing: -0.055em; font-variant-numeric: tabular-nums; }
.figure small, .figure .minor { font-size: 0.52em; font-weight: 300; letter-spacing: -0.04em; color: var(--text-3); }
.figure.m { font-size: clamp(2.5rem, 5vw, 4rem); letter-spacing: -0.05em; }
.figure.s { font-size: 1.875rem; font-weight: 400; letter-spacing: -0.035em; }

/* Píldora de dato o filtro. */
.pill { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 14px; border-radius: var(--radius-pill); background: var(--surface); font-size: 0.8125rem; font-weight: 500; white-space: nowrap; }
.pill.on { background: var(--ink); color: #fff; }
.pill.ok { background: var(--ok-soft); color: #145c2d; }
.pill.warn { background: var(--warn-soft); color: #7a4200; }
.pill.lime { background: var(--lime); color: var(--ink); font-weight: 600; }
.pill.sunk { background: var(--paper); }

/* Pieza de tinta: lo importante del momento. */
.ink-card { border-radius: var(--radius); padding: 20px; background: var(--ink); color: #fff; }
.ink-card .cap { color: var(--lime); font-size: 0.875rem; font-weight: 500; }
.ink-card .dim { color: rgba(255, 255, 255, 0.62); }

/* Acción principal: píldora lima con el botón redondo de flecha a la derecha. */
.cta { display: flex; align-items: center; justify-content: space-between; gap: 16px; width: 100%; min-height: 56px; padding: 0 6px 0 22px; border: 0; border-radius: var(--radius-pill); background: var(--lime); color: var(--ink); font: inherit; font-size: 1rem; font-weight: 600; cursor: pointer; text-decoration: none; transition: transform 160ms var(--ease-out), background-color 160ms ease; }
.cta::after { content: ""; flex: none; width: 44px; height: 44px; border-radius: 50%; background: var(--ink) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 17 17 7M9 7h8v8'/%3E%3C/svg%3E") center / 18px no-repeat; }
.cta:active { transform: scale(0.98); background: var(--lime-strong); }
.cta.inline { width: auto; display: inline-flex; }
.cta.dark { background: var(--ink); color: #fff; }
.cta.dark::after { background-color: var(--lime); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2311120d' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 17 17 7M9 7h8v8'/%3E%3C/svg%3E"); }

/* Barra de avance: hecho en lima, extra en ámbar, pendiente rayado.
   Cada tramo es un <i> con la clase de su tipo y flex-grow igual a su valor. */
/* Se llama .progress; «.bar» en un div, span o p es su alias (la barra superior
   de app.css también se llama .bar y es un <header>: no debe alcanzarla). */
:is(.progress, div.bar, span.bar, p.bar) { display: flex; gap: 4px; height: 14px; }
:is(.progress, div.bar, span.bar, p.bar) > i { display: block; border-radius: var(--radius-pill); background: var(--lime); min-width: 6px; }
:is(.progress, div.bar, span.bar, p.bar) > i.extra { background: var(--double-fill); }
:is(.progress, div.bar, span.bar, p.bar) > i.rest { background: var(--hatch); }

.cta:disabled { opacity: 0.45; cursor: default; transform: none; }
.pill.bad { background: var(--danger-soft); color: #8f1f10; }
