/* ============================================================
   HALOGEN KIT — sistema de diseño
   Dark · Kinetic · Single accent
   Profundidad por anillos, radios que mutan y un único acento
   de alto voltaje. Aislado del resto del sitio para poder
   reutilizarlo en otras apps.
   ============================================================ */

:root {
    /* Paleta 06 · HALOGEN 47 */
    --canvas: #0a0d0a;
    --surface: #12160f;
    --raised: #1a1f18;
    --hairline: #2a312a;
    --halogen: #a3e635;
    --ink: #f2f5f0;
    --ink-dim: #8f9a8c;

    --halogen-soft: rgba(163, 230, 53, .14);
    --halogen-glow: rgba(163, 230, 53, .35);
    --unchecked: #3a423a;

    /* Radios que mutan: pastilla en reposo, 10px al activarse */
    --r-pill: 999px;
    --r-morph: 10px;
    --r-card: 20px;
    --r-tile: 12px;

    --morph: 180ms cubic-bezier(.2, .8, .2, 1);

    --font-sans: 'Inter Tight', 'Inter', system-ui, -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    background: var(--canvas);
    color: var(--ink);
    font-family: var(--font-sans);
    font-size: 15px;
    line-height: 1.45;
}

button, input, select, textarea {
    font-family: inherit;
    color: inherit;
    font-size: inherit;
}

/* Anillo de foco: 2px halógeno, en todo control enfocable */
:where(a, button, input, select, textarea, [tabindex]):focus-visible {
    outline: 2px solid var(--halogen);
    outline-offset: 2px;
    border-radius: var(--r-morph);
}

::selection { background: var(--halogen); color: var(--canvas); }

/* ------------------------------------------------------------
   FONDO: rejilla tenue + resplandor + arco discontinuo
   ------------------------------------------------------------ */
.hk-backdrop {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background-image:
        radial-gradient(720px 420px at 92% -6%, rgba(163, 230, 53, .10), transparent 62%),
        linear-gradient(rgba(255, 255, 255, .022) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, .022) 1px, transparent 1px);
    background-size: 100% 100%, 48px 48px, 48px 48px;
}

.hk-backdrop::after {
    content: '';
    position: absolute;
    top: -34vh;
    right: -22vw;
    width: 78vw;
    height: 78vw;
    border-radius: 50%;
    border: 1px dashed rgba(163, 230, 53, .12);
}

/* ------------------------------------------------------------
   MICRO-TIPOGRAFÍA
   ------------------------------------------------------------ */
.hk-meta {
    font-family: var(--font-mono);
    font-size: 10.5px;
    font-weight: 400;
    letter-spacing: .22em;
    text-transform: uppercase;
    color: var(--ink-dim);
}

.hk-meta--accent { color: var(--halogen); }

.hk-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-family: var(--font-mono);
    font-size: 10.5px;
    letter-spacing: .22em;
    text-transform: uppercase;
    color: var(--halogen);
}

.hk-eyebrow::before {
    content: '';
    width: 24px;
    height: 1px;
    background: currentColor;
}

.hk-display {
    font-weight: 900;
    letter-spacing: -.04em;
    line-height: .92;
}

.hk-num {
    font-variant-numeric: tabular-nums;
    font-weight: 700;
}

/* ------------------------------------------------------------
   BALDOSA DE ICONO
   ------------------------------------------------------------ */
.hk-tile {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    flex: 0 0 auto;
    border-radius: var(--r-tile);
    background: var(--halogen);
    color: var(--canvas);
    box-shadow: 0 0 0 1px rgba(163, 230, 53, .35), 0 0 24px var(--halogen-glow);
}

.hk-tile svg { width: 17px; height: 17px; display: block; }

.hk-tile--soft {
    background: var(--halogen-soft);
    color: var(--halogen);
    box-shadow: inset 0 0 0 1px rgba(163, 230, 53, .28);
}

/* ------------------------------------------------------------
   PASTILLA DE ESTADO
   ------------------------------------------------------------ */
.hk-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 13px;
    border-radius: var(--r-pill);
    background: rgba(163, 230, 53, .07);
    box-shadow: inset 0 0 0 1px rgba(163, 230, 53, .4);
    font-family: var(--font-mono);
    font-size: 10.5px;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: var(--halogen);
    white-space: nowrap;
}

.hk-chip::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--halogen);
    box-shadow: 0 0 8px var(--halogen);
}

.hk-chip--mute {
    background: rgba(255, 255, 255, .03);
    box-shadow: inset 0 0 0 1px var(--hairline);
    color: var(--ink-dim);
}
.hk-chip--mute::before { background: var(--ink-dim); box-shadow: none; }

/* ------------------------------------------------------------
   TARJETA CON ANILLO
   ------------------------------------------------------------ */
.hk-card {
    background: var(--surface);
    border-radius: var(--r-card);
    box-shadow: inset 0 0 0 1px var(--hairline), 0 18px 44px rgba(0, 0, 0, .45);
    padding: 16px;
}

.hk-card__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

/* ------------------------------------------------------------
   PESTAÑAS · radio mutante (pastilla → 10px)
   ------------------------------------------------------------ */
.hk-tabs {
    display: inline-flex;
    gap: 4px;
    padding: 4px;
    border-radius: var(--r-pill);
    background: rgba(10, 13, 10, .82);
    box-shadow: inset 0 0 0 1px var(--hairline);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: border-radius var(--morph);
}

.hk-tabs:has(.hk-tab[aria-pressed="true"]) { border-radius: calc(var(--r-morph) + 4px); }

.hk-tab {
    border: 0;
    background: transparent;
    color: var(--ink-dim);
    font-size: 12.5px;
    font-weight: 700;
    padding: 7px 16px;
    border-radius: var(--r-pill);
    cursor: pointer;
    white-space: nowrap;
    transition: background var(--morph), color var(--morph), border-radius var(--morph);
}

.hk-tab:hover { color: var(--ink); }

.hk-tab[aria-pressed="true"] {
    background: var(--halogen);
    color: var(--canvas);
    border-radius: var(--r-morph);
    box-shadow: 0 4px 18px rgba(163, 230, 53, .28);
}

.hk-tabs--block { display: flex; width: 100%; }
.hk-tabs--block .hk-tab { flex: 1 1 0; text-align: center; }

/* ------------------------------------------------------------
   BOTONES
   ------------------------------------------------------------ */
.hk-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 10px 18px;
    border: 0;
    border-radius: var(--r-pill);
    background: transparent;
    color: var(--ink);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: inset 0 0 0 1px var(--hairline);
    transition: background var(--morph), box-shadow var(--morph), border-radius var(--morph);
}

.hk-btn:hover {
    background: rgba(255, 255, 255, .04);
    box-shadow: inset 0 0 0 1px rgba(163, 230, 53, .45);
    border-radius: var(--r-morph);
}

.hk-btn:active { transform: translateY(1px); }

.hk-btn svg { width: 14px; height: 14px; flex: 0 0 auto; }

.hk-btn--primary {
    background: var(--halogen);
    color: var(--canvas);
    box-shadow: 0 6px 22px rgba(163, 230, 53, .26);
}

.hk-btn--primary:hover {
    background: #b4f04a;
    box-shadow: 0 8px 28px rgba(163, 230, 53, .4);
}

/* La flecha empuja la acción hacia delante */
.hk-btn__arrow { transition: transform var(--morph); }
.hk-btn:hover .hk-btn__arrow { transform: translateX(3px); }

.hk-btn--block { width: 100%; }

.hk-btn:disabled { opacity: .4; cursor: not-allowed; }
.hk-btn:disabled:hover { background: transparent; box-shadow: inset 0 0 0 1px var(--hairline); }

/* Botón de icono cuadrado */
.hk-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: var(--r-morph);
    background: rgba(10, 13, 10, .82);
    color: var(--ink-dim);
    font-family: var(--font-mono);
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .04em;
    cursor: pointer;
    box-shadow: inset 0 0 0 1px var(--hairline);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: color var(--morph), box-shadow var(--morph), background var(--morph), border-radius var(--morph);
}

.hk-icon-btn:hover { color: var(--ink); box-shadow: inset 0 0 0 1px rgba(163, 230, 53, .45); }

.hk-icon-btn--wide { width: auto; min-width: 34px; padding: 0 11px; }

.hk-icon-btn[aria-pressed="true"] {
    background: var(--halogen);
    color: var(--canvas);
    border-radius: var(--r-pill);
    box-shadow: 0 4px 16px rgba(163, 230, 53, .3);
}

/* ------------------------------------------------------------
   CAMPO · prefijo >_ y anillo de foco
   ------------------------------------------------------------ */
.hk-field {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 13px;
    border-radius: var(--r-morph);
    background: var(--raised);
    box-shadow: inset 0 0 0 1px var(--hairline);
    transition: box-shadow var(--morph);
}

.hk-field:focus-within { box-shadow: inset 0 0 0 2px var(--halogen); }

.hk-field::before {
    content: '>_';
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--halogen);
    flex: 0 0 auto;
}

.hk-field input,
.hk-field textarea {
    flex: 1 1 auto;
    min-width: 0;
    border: 0;
    background: transparent;
    font-size: 13px;
    outline: none;
    resize: none;
}

.hk-field textarea { min-height: 54px; line-height: 1.5; resize: vertical; }
.hk-field--top { align-items: flex-start; }
.hk-field--top::before { margin-top: 3px; }

.hk-field input::placeholder,
.hk-field textarea::placeholder { color: var(--ink-dim); opacity: .7; }

/* ------------------------------------------------------------
   SELECT
   ------------------------------------------------------------ */
.hk-select {
    width: 100%;
    padding: 10px 34px 10px 13px;
    border: 0;
    border-radius: var(--r-morph);
    background: var(--raised);
    box-shadow: inset 0 0 0 1px var(--hairline);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'><path d='M2 4.5 6 8.5 10 4.5' fill='none' stroke='%23a3e635' stroke-width='1.6' stroke-linecap='round'/></svg>");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 12px;
    transition: box-shadow var(--morph);
}

.hk-select:hover { box-shadow: inset 0 0 0 1px rgba(163, 230, 53, .45); }
.hk-select option { background: var(--surface); color: var(--ink); }

/* ------------------------------------------------------------
   CASILLA CIRCULAR
   ------------------------------------------------------------ */
.hk-check {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 6px 0;
    cursor: pointer;
    font-size: 13px;
}

.hk-check input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.hk-check__dot {
    flex: 0 0 auto;
    position: relative;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: transparent;
    box-shadow: inset 0 0 0 1.5px var(--unchecked);
    transition: background var(--morph), box-shadow var(--morph);
}

.hk-check__dot::after {
    content: '';
    position: absolute;
    left: 6px;
    top: 5px;
    width: 5px;
    height: 9px;
    border: solid var(--canvas);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg) scale(0);
    transition: transform var(--morph);
}

.hk-check input:checked + .hk-check__dot {
    background: var(--halogen);
    box-shadow: 0 0 0 1px rgba(163, 230, 53, .4), 0 0 14px var(--halogen-glow);
}

.hk-check input:checked + .hk-check__dot::after { transform: rotate(45deg) scale(1); }

.hk-check input:focus-visible + .hk-check__dot { outline: 2px solid var(--halogen); outline-offset: 3px; }

.hk-check__label { flex: 1 1 auto; }

.hk-check__state {
    flex: 0 0 auto;
    font-family: var(--font-mono);
    font-size: 10.5px;
    color: var(--ink-dim);
}

.hk-check input:checked ~ .hk-check__state { color: var(--halogen); }

/* ------------------------------------------------------------
   SLIDER
   ------------------------------------------------------------ */
.hk-range {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 20px;
    background: transparent;
    cursor: pointer;
}

.hk-range::-webkit-slider-runnable-track {
    height: 2px;
    border-radius: 2px;
    background: var(--hairline);
}

.hk-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    margin-top: -6px;
    border-radius: 50%;
    background: var(--halogen);
    border: 0;
    box-shadow: 0 0 0 3px var(--canvas), 0 0 14px var(--halogen-glow);
    transition: box-shadow var(--morph);
}

.hk-range::-moz-range-track {
    height: 2px;
    border-radius: 2px;
    background: var(--hairline);
}

.hk-range::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--halogen);
    border: 0;
    box-shadow: 0 0 0 3px var(--canvas), 0 0 14px var(--halogen-glow);
}

.hk-range:active::-webkit-slider-thumb { box-shadow: 0 0 0 3px var(--canvas), 0 0 22px var(--halogen); }

/* ------------------------------------------------------------
   CIFRA + MICRO-ETIQUETA
   ------------------------------------------------------------ */
.hk-stat { display: flex; flex-direction: column; gap: 2px; }

.hk-stat__value {
    font-size: 19px;
    font-weight: 700;
    line-height: 1;
    color: var(--halogen);
    font-variant-numeric: tabular-nums;
}

.hk-stat__value--ink { color: var(--ink); }

.hk-stat__label {
    font-family: var(--font-mono);
    font-size: 9.5px;
    letter-spacing: .2em;
    text-transform: uppercase;
    color: var(--ink-dim);
}

.hk-divider {
    width: 1px;
    align-self: stretch;
    background: var(--hairline);
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        transition-duration: .01ms !important;
        animation-duration: .01ms !important;
    }
}
