/* ============================================================
   iBlocker PRO · Design System "Liquid Glass" v2 · PREMIUM
   - Mesh gradient animado, bordes cónicos rotatorios
   - Botones con degradado en movimiento + barrido de luz
   - Glass translúcido con glow ambiental
   Tema: DARK por defecto · LIGHT opcional ([data-theme="light"])
   ============================================================ */

/* Ángulo animable para bordes cónicos */
@property --gb-angle { syntax: "<angle>"; inherits: false; initial-value: 0deg; }

/* ---------- 1. Tokens · DARK (por defecto) ---------- */
:root {
    color-scheme: dark;

    /* Superficies: más translúcidas, deja ver el mesh */
    --bg: #060514;
    --bg-tint-a: rgba(124, 58, 237, 0.28);
    --bg-tint-b: rgba(34, 211, 238, 0.18);
    --bg-tint-c: rgba(236, 72, 153, 0.16);
    --bg-tint-d: rgba(79, 70, 229, 0.22);
    --surface: rgba(18, 18, 38, 0.52);
    --surface-strong: rgba(24, 24, 48, 0.92);
    --surface-soft: rgba(255, 255, 255, 0.05);
    --field: rgba(255, 255, 255, 0.06);
    --glass-border: rgba(255, 255, 255, 0.10);
    --glass-border-strong: rgba(255, 255, 255, 0.18);
    --card-glow: rgba(255, 255, 255, 0.06);
    --btn-fill: rgba(22, 22, 44, 0.88);

    /* Texto */
    --text-main: #f6f5ff;
    --text-dim: #9aa3c0;
    --text-faint: rgba(154, 163, 192, 0.55);

    /* Acentos vivos: violeta → indigo → cian + pink */
    --primary: #8b7cff;
    --primary-deep: #7c3aed;
    --accent: #22d3ee;
    --accent-2: #0ea5e9;
    --accent-3: #f472b6;
    --grad-primary: linear-gradient(120deg, #7c3aed 0%, #4f46e5 35%, #0ea5e9 72%, #22d3ee 100%);
    --grad-ring: conic-gradient(from var(--gb-angle),
        rgba(167, 139, 250, 0.65), rgba(34, 211, 238, 0.40) 28%,
        rgba(244, 114, 182, 0.45) 55%, rgba(99, 102, 241, 0.55) 78%,
        rgba(167, 139, 250, 0.65));
    --grad-primary-soft: linear-gradient(135deg, rgba(124, 58, 237, 0.20), rgba(14, 165, 233, 0.20));
    --primary-glow: rgba(124, 58, 237, 0.50);
    --accent-glow: rgba(34, 211, 238, 0.40);
    --focus-ring: rgba(139, 124, 255, 0.45);

    /* Estados */
    --success: #34d399;
    --success-bg: rgba(52, 211, 153, 0.14);
    --success-border: rgba(52, 211, 153, 0.38);
    --warning: #fbbf24;
    --warning-bg: rgba(251, 191, 36, 0.14);
    --warning-border: rgba(251, 191, 36, 0.38);
    --error: #fb7185;
    --error-bg: rgba(251, 113, 133, 0.12);
    --error-border: rgba(251, 113, 133, 0.38);
    --info: #38bdf8;
    --info-bg: rgba(56, 189, 248, 0.14);
    --info-border: rgba(56, 189, 248, 0.36);

    /* Sombras */
    --shadow-card: 0 30px 70px -35px rgba(0, 0, 0, 0.85), 0 24px 70px -40px var(--primary-glow);
    --shadow-pop: 0 40px 100px -25px rgba(0, 0, 0, 0.85), 0 0 60px -20px var(--primary-glow);
    --shadow-btn: 0 14px 34px -10px rgba(124, 58, 237, 0.60), 0 5px 16px -6px var(--accent-glow);

    /* Geometría */
    --r-xl: 28px;
    --r-lg: 20px;
    --r-md: 14px;
    --r-sm: 10px;
    --nav-height: 64px;

    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
    --font: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'SF Pro Display', sans-serif;
    --font-display: 'Space Grotesk', 'Plus Jakarta Sans', -apple-system, sans-serif;
    --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', monospace;
}

/* ---------- 2. Tokens · LIGHT (vivos pero legibles) ---------- */
[data-theme="light"] {
    color-scheme: light;

    --bg: #f0f1fb;
    --bg-tint-a: rgba(124, 58, 237, 0.20);
    --bg-tint-b: rgba(14, 165, 233, 0.16);
    --bg-tint-c: rgba(236, 72, 153, 0.12);
    --bg-tint-d: rgba(79, 70, 229, 0.14);
    --surface: rgba(255, 255, 255, 0.62);
    --surface-strong: rgba(255, 255, 255, 0.96);
    --surface-soft: rgba(124, 58, 237, 0.05);
    --field: rgba(124, 58, 237, 0.06);
    --glass-border: rgba(124, 58, 237, 0.14);
    --glass-border-strong: rgba(124, 58, 237, 0.24);
    --card-glow: rgba(124, 58, 237, 0.07);
    --btn-fill: rgba(255, 255, 255, 0.94);

    --text-main: #171331;
    --text-dim: #5b5f85;
    --text-faint: rgba(91, 95, 133, 0.6);

    --primary: #6d28d9;
    --primary-deep: #6d28d9;
    --accent: #0891b2;
    --accent-2: #0284c7;
    --accent-3: #db2777;
    --grad-primary: linear-gradient(120deg, #7c3aed 0%, #4f46e5 35%, #0ea5e9 72%, #22d3ee 100%);
    --grad-ring: conic-gradient(from var(--gb-angle),
        rgba(124, 58, 237, 0.55), rgba(8, 145, 178, 0.40) 28%,
        rgba(219, 39, 119, 0.40) 55%, rgba(79, 70, 229, 0.45) 78%,
        rgba(124, 58, 237, 0.55));
    --grad-primary-soft: linear-gradient(135deg, rgba(124, 58, 237, 0.12), rgba(8, 145, 178, 0.12));
    --primary-glow: rgba(124, 58, 237, 0.35);
    --accent-glow: rgba(8, 145, 178, 0.30);
    --focus-ring: rgba(124, 58, 237, 0.30);

    --success: #047857;
    --success-bg: rgba(4, 120, 87, 0.10);
    --success-border: rgba(4, 120, 87, 0.32);
    --warning: #b45309;
    --warning-bg: rgba(180, 83, 9, 0.10);
    --warning-border: rgba(180, 83, 9, 0.32);
    --error: #dc2626;
    --error-bg: rgba(220, 38, 38, 0.08);
    --error-border: rgba(220, 38, 38, 0.30);
    --info: #0369a1;
    --info-bg: rgba(3, 105, 161, 0.10);
    --info-border: rgba(3, 105, 161, 0.28);

    --shadow-card: 0 30px 60px -35px rgba(23, 19, 49, 0.35), 0 20px 60px -35px var(--primary-glow);
    --shadow-pop: 0 40px 90px -25px rgba(23, 19, 49, 0.40), 0 0 50px -20px var(--primary-glow);
    --shadow-btn: 0 14px 30px -10px rgba(124, 58, 237, 0.45), 0 5px 14px -6px var(--accent-glow);
}

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

html { scroll-behavior: smooth; scrollbar-width: thin; scrollbar-color: var(--primary-deep) transparent; }

body {
    font-family: var(--font);
    background-color: var(--bg);
    color: var(--text-main);
    min-height: 100vh;
    display: flex; flex-direction: column; align-items: center;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
    transition: background-color .5s ease, color .35s ease;
}

/* MESH GRADIENT ANIMADO — el fondo vive */
body::before {
    content: "";
    position: fixed; inset: -20%; z-index: -2;
    background:
        radial-gradient(42rem 30rem at 12% -8%, var(--bg-tint-a), transparent 62%),
        radial-gradient(36rem 26rem at 95% 4%, var(--bg-tint-b), transparent 62%),
        radial-gradient(40rem 30rem at 55% 115%, var(--bg-tint-c), transparent 60%),
        radial-gradient(32rem 24rem at 85% 88%, var(--bg-tint-d), transparent 60%);
    pointer-events: none;
    filter: saturate(150%);
    animation: meshMove 22s ease-in-out infinite alternate;
    transition: background .5s ease;
}
@keyframes meshMove {
    0%   { background-position: 0% 0%, 100% 0%, 50% 110%, 90% 90%; transform: scale(1); }
    50%  { background-position: 22% 14%, 78% 10%, 44% 88%, 72% 64%; transform: scale(1.06); }
    100% { background-position: 8% 26%, 62% 2%, 62% 102%, 100% 80%; transform: scale(1); }
}

/* Grano fino encima del mesh */
body::after {
    content: "";
    position: fixed; inset: 0; z-index: -1; pointer-events: none;
    opacity: .4;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.035 0'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}

::selection { background: rgba(124, 58, 237, 0.45); color: #fff; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--primary-deep), var(--accent-2));
    border-radius: 99px; border: 3px solid var(--bg);
}

:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 6px; }

h1, h2, h3 { font-family: var(--font-display); letter-spacing: -0.02em; }

/* ---------- 4. Navbar liquid glass con hairline degradado ---------- */
.nav-container {
    position: fixed; top: 0; left: 0; right: 0; width: 100%;
    height: var(--nav-height);
    display: flex; justify-content: center; z-index: 900;
    background: var(--surface);
    -webkit-backdrop-filter: blur(26px) saturate(180%);
    backdrop-filter: blur(26px) saturate(180%);
    border-bottom: 1px solid transparent;
}
.nav-container::after {
    content: "";
    position: absolute; bottom: 0; left: 5%; right: 5%; height: 2px;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(139,124,255,.35) 10%,
        rgba(139,124,255,.65) 30%,
        rgba(34,211,238,.55) 50%,
        rgba(244,114,182,.45) 70%,
        rgba(244,114,182,.35) 90%,
        transparent 100%);
    /* Grosor que se desvanece hacia las puntas (lente afilada);
       el fundido horizontal vive en el alpha del degradado */
    -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 45%, #000 55%, transparent 100%);
    mask-image: linear-gradient(180deg, transparent 0%, #000 45%, #000 55%, transparent 100%);
    pointer-events: none;
}

/* Cometa que recorre la línea: elemento píldora inyectado por app.js.
   Viaja exactamente entre los mismos márgenes que la línea (5%–95%)
   y se escala fino → grueso → fino para nacer y morir en punta. */
.line-comet {
    position: absolute;
    left: 5%;
    width: 150px; height: 2px;
    border-radius: 999px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,.95) 50%, transparent);
    mix-blend-mode: screen;
    pointer-events: none;
    z-index: 2;
    opacity: 0;
    will-change: transform, opacity;
    -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 40%, #000 60%, transparent 100%);
    mask-image: linear-gradient(180deg, transparent 0%, #000 40%, #000 60%, transparent 100%);
    animation: cometTravel 5.5s ease-in-out infinite;
}
.nav-container .line-comet { bottom: 0; }
.footer-premium .line-comet { top: 0; } /* misma duración y fase que el nav: trayectoria uniforme */
[data-theme="light"] .line-comet {
    background: linear-gradient(90deg, transparent, rgba(124,58,237,.85) 50%, transparent);
    mix-blend-mode: normal;
}
/* Nace en punta (fino + transparente), se engorda al centro y muere en punta */
@keyframes cometTravel {
    0%   { transform: translateX(0) scaleX(.3); opacity: 0; }
    12%  { opacity: .9; }
    50%  { transform: translateX(calc(var(--comet-dist, 600px) * .5)) scaleX(1); opacity: 1; }
    88%  { opacity: .9; }
    100% { transform: translateX(var(--comet-dist, 600px)) scaleX(.3); opacity: 0; }
}
/* (linePulse eliminado — el destello ahora es el elemento .line-comet) */
.nav-content {
    width: 92%; max-width: 1100px;
    display: flex; justify-content: space-between; align-items: center;
}
.brand {
    display: flex; align-items: center; gap: 10px;
    font-family: var(--font-display);
    font-weight: 800; font-size: 16.5px; letter-spacing: -0.3px;
    text-decoration: none; color: var(--text-main);
}
.brand-icon {
    width: 32px; height: 32px; border-radius: 11px;
    background: var(--grad-primary);
    background-size: 160% 160%;
    display: inline-flex; align-items: center; justify-content: center;
    color: #fff; flex: none;
    box-shadow: 0 8px 20px -6px var(--primary-glow), 0 3px 8px -3px var(--accent-glow), inset 0 1px 0 rgba(255,255,255,.45);
    animation: gradShift 6s ease infinite;
}
.brand-icon svg { width: 17px; height: 17px; }
.brand .text-primary {
    background: var(--grad-primary);
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent;
}
.menu { display: flex; align-items: center; gap: 10px; }

.chip-link {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 15px; border-radius: 999px;
    background: var(--surface-soft);
    border: 1px solid var(--glass-border);
    color: var(--text-dim); text-decoration: none;
    font-size: 12.5px; font-weight: 600;
    transition: all .3s var(--ease-out);
    -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.chip-link:hover {
    color: var(--primary); border-color: var(--glass-border-strong);
    transform: translateY(-1px);
    box-shadow: 0 6px 18px -8px var(--primary-glow);
}

.icon-btn {
    width: 38px; height: 38px; flex: none;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 12px; cursor: pointer;
    background: var(--surface-soft);
    border: 1px solid var(--glass-border);
    color: var(--text-dim);
    transition: all .3s var(--ease-out);
    -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.icon-btn:hover {
    color: var(--primary); border-color: var(--glass-border-strong);
    transform: translateY(-1px) rotate(8deg);
    box-shadow: 0 6px 18px -8px var(--primary-glow);
}
.icon-btn svg { width: 18px; height: 18px; }

/* ---------- 5. Cards glass premium · borde cónico rotatorio ---------- */
.card {
    position: relative;
    background:
        radial-gradient(460px circle at var(--mx, 50%) var(--my, 12%), var(--card-glow), transparent 58%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0) 32%),
        var(--surface);
    -webkit-backdrop-filter: blur(36px) saturate(180%);
    backdrop-filter: blur(36px) saturate(180%);
    border: 1px solid var(--glass-border);
    border-radius: var(--r-xl);
    box-shadow: var(--shadow-card);
    padding: 30px;
    margin-bottom: 20px;
    transition: box-shadow .4s ease, border-color .4s ease;
}
[data-theme="light"] .card { box-shadow: var(--shadow-card); }

/* Borde degradado que rota (overlay) */
.card::before {
    content: "";
    position: absolute; inset: -1px;
    border-radius: inherit;
    padding: 1px;
    background:
        radial-gradient(150px circle at var(--mx, 50%) var(--my, 0%), rgba(255,255,255,.95), transparent 55%),
        var(--grad-ring);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
            mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
            mask-composite: exclude;
    opacity: .45;
    transition: opacity .4s ease;
    animation: rotateRing 8s linear infinite;
    pointer-events: none;
    z-index: 1;
}
.card:hover::before { opacity: .9; }
@keyframes rotateRing { to { --gb-angle: 360deg; } }
@keyframes gradShift { 0%, 100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }

/* Barrido de luz líquido */
.card-shimmer { position: relative; overflow: hidden; }
.card-shimmer::after {
    content: "";
    position: absolute; top: -60%; left: -30%;
    width: 45%; height: 220%;
    background: linear-gradient(100deg, transparent, rgba(255,255,255,.07), transparent);
    transform: rotate(12deg);
    animation: shimmer 5.5s ease-in-out infinite;
    pointer-events: none;
    z-index: 2;
}
@keyframes shimmer {
    0% { left: -40%; }
    55%, 100% { left: 130%; }
}

.card-label {
    font-size: 11px; text-transform: uppercase; letter-spacing: 2px;
    color: var(--text-dim); font-weight: 800;
    display: flex; align-items: center; gap: 8px;
}
.card-label svg { width: 13px; height: 13px; color: var(--primary); filter: drop-shadow(0 0 6px var(--primary-glow)); }

.section-title {
    font-size: 20px; font-weight: 800; letter-spacing: -0.4px;
}

/* ---------- 6. Botones premium ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 9px;
    padding: 15px 22px; border-radius: 16px;
    font-family: var(--font); font-size: 14px; font-weight: 800; letter-spacing: .1px;
    cursor: pointer; text-decoration: none; border: none;
    transition: transform .25s var(--ease-spring), box-shadow .35s ease, background-position .6s ease, color .25s ease, border-color .25s ease;
    position: relative; overflow: hidden;
    -webkit-tap-highlight-color: transparent;
}
.btn svg { width: 17px; height: 17px; flex: none; }
.btn:active { transform: scale(0.97) translateY(0); }

/* Primario: degradado en movimiento + gloss + barrido de luz */
.btn-primary {
    background: var(--grad-primary);
    background-size: 200% 200%;
    background-position: 0% 50%;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0,0,0,.18);
    box-shadow: var(--shadow-btn), inset 0 1px 0 rgba(255, 255, 255, 0.40), inset 0 -2px 8px rgba(0, 0, 0, 0.18);
}
.btn-primary::after {
    content: ""; position: absolute; inset: 0; border-radius: inherit;
    background: linear-gradient(180deg, rgba(255,255,255,.22), transparent 50%);
    pointer-events: none;
}
.btn-primary::before {
    content: ""; position: absolute; top: -10%; bottom: -10%; left: -80%;
    width: 45%;
    background: linear-gradient(100deg, transparent, rgba(255,255,255,.45), transparent);
    transform: skewX(-20deg);
    transition: left .7s var(--ease-out);
    pointer-events: none; z-index: 1;
}
.btn-primary:hover {
    background-position: 100% 50%;
    transform: translateY(-2px);
    box-shadow: 0 20px 44px -12px var(--primary-glow), 0 8px 20px -8px var(--accent-glow), inset 0 1px 0 rgba(255,255,255,.40);
}
.btn-primary:hover::before { left: 135%; }
.btn-primary:disabled { opacity: .65; cursor: not-allowed; transform: none; }

/* Glass con glow al hover */
.btn-glass {
    background: var(--surface-soft);
    -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border-strong);
    color: var(--text-main);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.08);
}
[data-theme="light"] .btn-glass { box-shadow: inset 0 1px 0 rgba(255,255,255,.8); }
.btn-glass:hover {
    border-color: var(--primary);
    transform: translateY(-1px);
    box-shadow: 0 8px 22px -10px var(--primary-glow), inset 0 1px 0 rgba(255,255,255,.12);
}

/* Outline con borde degradado real (double-background) */
.btn-outline-primary {
    border: 1.5px solid transparent;
    background:
        linear-gradient(var(--btn-fill), var(--btn-fill)) padding-box,
        linear-gradient(120deg, var(--primary-deep), var(--accent-2) 60%, var(--accent)) border-box;
    color: var(--primary);
    box-shadow: 0 6px 18px -10px var(--primary-glow);
}
.btn-outline-primary::after {
    content: ""; position: absolute; inset: 0; border-radius: inherit;
    background: linear-gradient(180deg, rgba(255,255,255,.10), transparent 55%);
    pointer-events: none;
}
.btn-outline-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 28px -10px var(--primary-glow);
}

.btn-danger-soft {
    background: var(--error-bg);
    border: 1px solid var(--error-border);
    color: var(--error);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.06);
}
.btn-danger-soft:hover { transform: translateY(-1px); box-shadow: 0 8px 22px -10px rgba(251,113,133,.5); }

.btn-success-soft {
    background: var(--success-bg);
    border: 1px solid var(--success-border);
    color: var(--success);
}
.btn-success-soft:hover { transform: translateY(-1px); box-shadow: 0 8px 22px -10px rgba(52,211,153,.5); }

.btn-sm { padding: 10px 14px; font-size: 12.5px; border-radius: 12px; }
.btn-sm svg { width: 14px; height: 14px; }

/* Spinner dentro de botones */
.btn-spinner {
    width: 17px; height: 17px; flex: none;
    border: 2px solid rgba(255,255,255,.35);
    border-top-color: #fff; border-radius: 50%;
    animation: spin .7s linear infinite;
}
.btn-glass .btn-spinner, .btn-outline-primary .btn-spinner, .btn-danger-soft .btn-spinner, .btn-success-soft .btn-spinner {
    border-color: color-mix(in srgb, var(--text-dim) 40%, transparent);
    border-top-color: var(--text-main);
}

/* Ripple al pulsar (generado por app.js) */
.btn .ripple {
    position: absolute; border-radius: 50%;
    background: radial-gradient(circle, rgba(255,255,255,.55), transparent 62%);
    transform: scale(0); opacity: 1;
    animation: rippleAnim .65s ease-out forwards;
    pointer-events: none; z-index: 0;
}
@keyframes rippleAnim { to { transform: scale(1); opacity: 0; } }

/* ---------- 7. Inputs ---------- */
.input {
    width: 100%;
    background: var(--field);
    -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: var(--r-md);
    padding: 14px 16px;
    color: var(--text-main);
    font-family: var(--mono);
    font-size: 13.5px;
    outline: none;
    transition: border-color .25s ease, box-shadow .3s ease, background .25s ease;
    user-select: text;
}
.input::placeholder { color: var(--text-faint); }
.input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--focus-ring), 0 0 26px -6px var(--primary-glow);
    background: var(--surface-soft);
}
.input.is-invalid {
    border-color: var(--error);
    box-shadow: 0 0 0 4px var(--error-bg);
    animation: shake .4s var(--ease-out);
}

/* Input grande tipo PIN */
.input-pin {
    font-size: 24px; letter-spacing: 10px; text-align: center;
    padding: 16px; font-weight: 700;
}
.input-pin::placeholder { letter-spacing: 10px; }

/* ---------- 8. Badges / chips ---------- */
.badge {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    height: 28px; padding: 0 13px;
    border-radius: 999px;
    font-size: 10.5px; font-weight: 800; letter-spacing: .6px; text-transform: uppercase;
    white-space: nowrap;
    -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.10);
}
[data-theme="light"] .badge { box-shadow: inset 0 1px 0 rgba(255,255,255,.7); }
.badge svg { width: 12px; height: 12px; }
.badge-neutral { background: var(--surface-soft); color: var(--text-dim); border: 1px solid var(--glass-border); }
.badge-primary {
    background: var(--grad-primary); background-size: 180% 180%;
    color: #fff; border: none;
    box-shadow: 0 6px 18px -6px var(--primary-glow), inset 0 1px 0 rgba(255,255,255,.35);
    animation: gradShift 6s ease infinite;
}
.badge-success { background: var(--success-bg); color: var(--success); border: 1px solid var(--success-border); }
.badge-error   { background: var(--error-bg);   color: var(--error);   border: 1px solid var(--error-border); }
.badge-warning { background: var(--warning-bg); color: var(--warning); border: 1px solid var(--warning-border); }
.badge-info    { background: var(--info-bg);    color: var(--info);    border: 1px solid var(--info-border); }

/* Punto con pulso */
.pulse-dot {
    width: 8px; height: 8px; border-radius: 50%; flex: none;
    background: currentColor;
    box-shadow: 0 0 8px currentColor;
    animation: pulseDot 2s ease-out infinite;
}
@keyframes pulseDot {
    0% { box-shadow: 0 0 0 0 color-mix(in srgb, currentColor 60%, transparent); }
    70% { box-shadow: 0 0 0 9px transparent; }
    100% { box-shadow: 0 0 0 0 transparent; }
}

/* ---------- 9. Modales liquid glass ---------- */
.modal-overlay {
    position: fixed; inset: 0; z-index: 2000;
    display: flex; align-items: center; justify-content: center;
    padding: 20px;
    background: transparent;
    -webkit-backdrop-filter: blur(0px); backdrop-filter: blur(0px);
    opacity: 0; visibility: hidden;
    transition: opacity .35s ease, visibility .35s ease, background .35s ease, backdrop-filter .35s ease;
}
.modal-overlay.active {
    opacity: 1; visibility: visible;
    background: color-mix(in srgb, var(--bg) 50%, transparent);
    -webkit-backdrop-filter: blur(18px) saturate(130%); backdrop-filter: blur(18px) saturate(130%);
}
.modal-card {
    width: 100%; max-width: 400px;
    background:
        radial-gradient(340px circle at var(--mx, 50%) var(--my, 10%), var(--card-glow), transparent 60%),
        linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,0) 30%),
        var(--surface-strong);
    -webkit-backdrop-filter: blur(40px) saturate(180%); backdrop-filter: blur(40px) saturate(180%);
    border: 1px solid var(--glass-border-strong);
    border-radius: var(--r-xl);
    padding: 30px;
    box-shadow: var(--shadow-pop);
    transform: scale(.9) translateY(24px);
    opacity: 0;
    transition: transform .5s var(--ease-spring), opacity .35s ease;
    position: relative; overflow: hidden;
}
.modal-overlay.active .modal-card { transform: scale(1) translateY(0); opacity: 1; }
.modal-card::before {
    content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1px;
    background:
        radial-gradient(130px circle at var(--mx, 50%) var(--my, 0%), rgba(255,255,255,.9), transparent 55%),
        var(--grad-ring);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
            mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
            mask-composite: exclude;
    opacity: .6; pointer-events: none;
    animation: rotateRing 8s linear infinite;
}
.modal-title { font-size: 19px; font-weight: 800; letter-spacing: -.3px; text-align: center; margin-bottom: 8px; }
.modal-text { font-size: 13.5px; color: var(--text-dim); text-align: center; line-height: 1.65; margin-bottom: 24px; }
.modal-close-x {
    position: absolute; top: 14px; right: 14px; z-index: 5;
    width: 32px; height: 32px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    background: var(--surface-soft); border: 1px solid var(--glass-border);
    color: var(--text-dim); cursor: pointer;
    transition: all .25s ease;
}
.modal-close-x:hover { color: var(--text-main); border-color: var(--glass-border-strong); transform: rotate(90deg); }
.modal-close-x svg { width: 15px; height: 15px; }

/* Icono hero del modal — tile degradado con glow */
.hero-icon {
    width: 62px; height: 62px; margin: 0 auto 18px auto;
    border-radius: 20px;
    display: flex; align-items: center; justify-content: center;
    position: relative;
    background: var(--grad-primary);
    background-size: 180% 180%;
    color: #fff;
    border: none;
    animation: gradShift 7s ease infinite;
    box-shadow: 0 16px 36px -12px var(--primary-glow), 0 6px 16px -8px var(--accent-glow), inset 0 1px 0 rgba(255,255,255,.45);
}
.hero-icon svg { width: 30px; height: 30px; filter: drop-shadow(0 2px 4px rgba(0,0,0,.2)); }
.hero-icon.is-success {
    background: linear-gradient(135deg, rgba(52,211,153,.28), rgba(16,185,129,.16));
    color: var(--success);
    border: 1px solid var(--success-border);
    box-shadow: 0 16px 36px -14px rgba(52,211,153,.45), inset 0 1px 0 rgba(255,255,255,.15);
}
.hero-icon.is-error {
    background: linear-gradient(135deg, rgba(251,113,133,.28), rgba(225,29,72,.16));
    color: var(--error);
    border: 1px solid var(--error-border);
    box-shadow: 0 16px 36px -14px rgba(251,113,133,.45), inset 0 1px 0 rgba(255,255,255,.15);
}
.modal-overlay.active .hero-icon svg { animation: iconPop .55s var(--ease-spring) .25s both; }
.modal-overlay.active .hero-icon::after {
    content: ""; position: absolute; inset: 0; border-radius: inherit;
    border: 2px solid currentColor; opacity: 0;
    animation: iconRing .8s ease-out .45s forwards;
}
@keyframes iconPop { 0% { transform: scale(.4); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
@keyframes iconRing { 0% { transform: scale(1); opacity: .7; } 100% { transform: scale(1.55); opacity: 0; } }

/* dialogs nativos (rcode) con el mismo look */
dialog.custom-modal {
    border: 1px solid var(--glass-border-strong);
    padding: 30px; border-radius: var(--r-xl);
    background:
        radial-gradient(340px circle at var(--mx, 50%) var(--my, 10%), var(--card-glow), transparent 60%),
        linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,0) 30%),
        var(--surface-strong);
    -webkit-backdrop-filter: blur(40px) saturate(180%); backdrop-filter: blur(40px) saturate(180%);
    color: var(--text-main);
    position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);
    margin: 0; outline: none;
    box-shadow: var(--shadow-pop);
    width: 90%; max-width: 420px;
    overflow: visible;
}
dialog.custom-modal::before {
    content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1px;
    background:
        radial-gradient(130px circle at var(--mx, 50%) var(--my, 0%), rgba(255,255,255,.9), transparent 55%),
        var(--grad-ring);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
            mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
            mask-composite: exclude;
    opacity: .6; pointer-events: none;
    animation: rotateRing 8s linear infinite;
}
dialog::backdrop {
    background: color-mix(in srgb, var(--bg) 50%, transparent);
    -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
}
dialog[open] { animation: modalIn .45s var(--ease-spring) forwards; }
dialog.hide { animation: modalOut .25s ease forwards; }
@keyframes modalIn { from { opacity: 0; filter: blur(6px); transform: translate(-50%, -42%) scale(.92); } to { opacity: 1; filter: blur(0); transform: translate(-50%, -50%) scale(1); } }
@keyframes modalOut { from { opacity: 1; transform: translate(-50%, -50%) scale(1); } to { opacity: 0; transform: translate(-50%, -54%) scale(.94); } }

/* ---------- 10. Loader de página ---------- */
#loader {
    position: fixed; inset: 0; z-index: 3000;
    display: flex; flex-direction: column; gap: 18px;
    align-items: center; justify-content: center;
    background: var(--bg);
    transition: opacity .45s ease, visibility .45s ease;
}
#loader::before {
    content: "";
    position: absolute; width: 340px; height: 340px; border-radius: 50%;
    background: radial-gradient(circle, var(--primary-glow), transparent 65%);
    filter: blur(30px);
    animation: breathe 2s ease-in-out infinite;
}
#loader.hidden-loader { opacity: 0; visibility: hidden; }

.loader-orb {
    width: 58px; height: 58px; border-radius: 50%;
    position: relative;
    background: conic-gradient(from 0deg, transparent 0%, #7c3aed 22%, #22d3ee 48%, #f472b6 72%, transparent 96%);
    -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 4.5px), #000 calc(100% - 3.5px));
    mask: radial-gradient(farthest-side, transparent calc(100% - 4.5px), #000 calc(100% - 3.5px));
    animation: spin .85s linear infinite;
    filter: drop-shadow(0 0 14px var(--primary-glow)) drop-shadow(0 0 24px var(--accent-glow));
}
.loader-text {
    font-size: 10.5px; font-weight: 800; letter-spacing: 4px;
    text-transform: uppercase; color: var(--text-faint);
    animation: breathe 1.6s ease-in-out infinite;
}
@keyframes breathe { 0%, 100% { opacity: .45; } 50% { opacity: 1; } }

/* ---------- 11. Pasos (stepper) ---------- */
.step { opacity: 1; transition: opacity .4s ease; }
.step-locked { opacity: .4; pointer-events: none; filter: saturate(.5); }
.step-header { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.step-num {
    width: 32px; height: 32px; flex: none;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 14px;
    background: var(--grad-primary-soft);
    border: 1px solid var(--glass-border-strong);
    color: var(--primary);
    transition: all .35s var(--ease-spring);
}
.step.done .step-num {
    background: var(--grad-primary);
    background-size: 180% 180%;
    color: #fff; border-color: transparent;
    box-shadow: 0 8px 20px -6px var(--primary-glow), inset 0 1px 0 rgba(255,255,255,.4);
    animation: gradShift 6s ease infinite;
}
.step-title { font-weight: 700; font-size: 15px; letter-spacing: -.2px; }
.step-check { margin-left: auto; color: var(--success); display: none; animation: iconPop .4s var(--ease-spring) both; filter: drop-shadow(0 0 6px rgba(52,211,153,.5)); }
.step.done .step-check { display: inline-flex; }
.step-desc { font-size: 13px; color: var(--text-dim); line-height: 1.65; margin-bottom: 14px; }
.step-divider { border-top: 1px solid var(--glass-border); padding-top: 22px; margin-top: 22px; }

/* ---------- 12. Footer ---------- */
.footer-premium {
    width: 100%; padding: 44px 0 34px 0;
    border-top: 1px solid transparent;
    background: linear-gradient(to top, color-mix(in srgb, var(--bg) 72%, transparent), transparent);
    display: flex; flex-direction: column; align-items: center; gap: 14px;
    margin-top: auto;
    position: relative;
    -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.footer-premium::before {
    content: "";
    position: absolute; top: 0; left: 5%; right: 5%; height: 2px;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(139,124,255,.35) 10%,
        rgba(139,124,255,.65) 30%,
        rgba(34,211,238,.55) 50%,
        rgba(244,114,182,.45) 70%,
        rgba(244,114,182,.35) 90%,
        transparent 100%);
    -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 45%, #000 55%, transparent 100%);
    mask-image: linear-gradient(180deg, transparent 0%, #000 45%, #000 55%, transparent 100%);
}
.footer-tag {
    display: inline-flex; align-items: center; gap: 6px;
    background: var(--surface-soft);
    padding: 6px 14px; border-radius: 999px;
    border: 1px solid var(--glass-border);
    -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.footer-tag svg { width: 11px; height: 11px; color: var(--primary); filter: drop-shadow(0 0 5px var(--primary-glow)); }
.footer-tag span { font-size: 9.5px; font-weight: 700; color: var(--text-dim); letter-spacing: 1.2px; }
.footer-copy { font-size: 11px; color: var(--text-faint); font-weight: 500; }
.footer-links { display: flex; gap: 20px; }
.footer-links a {
    color: var(--text-dim); text-decoration: none; font-size: 11px;
    font-weight: 600; text-transform: uppercase; letter-spacing: 1px;
    transition: color .2s ease, text-shadow .2s ease;
}
.footer-links a:hover { color: var(--primary); text-shadow: 0 0 12px var(--primary-glow); }

/* ---------- 13. Utilidades ---------- */
.hidden { display: none !important; }
.mono { font-family: var(--mono); }
.text-dim { color: var(--text-dim); }
.text-success { color: var(--success); }
.text-error { color: var(--error); }
.text-primary { color: var(--primary); }

.stat-card {
    background: var(--surface-soft);
    border: 1px solid var(--glass-border);
    border-radius: var(--r-lg);
    padding: 14px; text-align: center;
    display: flex; flex-direction: column; gap: 6px; justify-content: center;
    -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
    transition: transform .3s var(--ease-out), border-color .3s ease, box-shadow .3s ease;
}
.stat-card:hover {
    transform: translateY(-3px);
    border-color: var(--glass-border-strong);
    box-shadow: 0 12px 28px -14px var(--primary-glow);
}
.stat-label { color: var(--text-faint); font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: 1px; }
.stat-value { font-family: var(--mono); font-size: 15px; font-weight: 700; color: var(--text-main); }

.code-display {
    font-family: var(--mono);
    font-size: clamp(34px, 9vw, 44px);
    font-weight: 700; letter-spacing: 10px; text-align: center;
    background: var(--grad-primary);
    background-size: 200% 200%;
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradShift 6s ease infinite;
    filter: drop-shadow(0 6px 26px var(--primary-glow));
    user-select: all;
}

.alert-box {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    padding: 12px 14px; border-radius: var(--r-md);
    font-size: 12px; font-weight: 600; text-align: center;
    -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.alert-box svg { width: 14px; height: 14px; flex: none; }
.alert-box.error { background: var(--error-bg); border: 1px solid var(--error-border); color: var(--error); }
.alert-box.success { background: var(--success-bg); border: 1px solid var(--success-border); color: var(--success); }
.alert-box.warning { background: var(--warning-bg); border: 1px solid var(--warning-border); color: var(--warning); }
.alert-box.info { background: var(--info-bg); border: 1px solid var(--info-border); color: var(--info); }

/* ---------- 14. Animaciones globales ---------- */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fadeIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-6px); }
    40%, 80% { transform: translateX(6px); }
}
.anim-fade { animation: fadeIn .55s var(--ease-out) both; }

/* Respeto por usuarios con motion reducido */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
    html { scroll-behavior: auto; }
    body::before { animation: none !important; }
}

/* ---------- 14b. FX premium: spotlight, reveal, tilt, view-transitions ---------- */

/* Foco de luz global que sigue el cursor (creado por app.js) */
#fx-spotlight {
    position: fixed; top: 0; left: 0;
    width: 600px; height: 600px; border-radius: 50%;
    pointer-events: none; z-index: -1;
    opacity: 0; transition: opacity .8s ease;
    background: radial-gradient(circle, rgba(139,124,255,.11), rgba(34,211,238,.05) 38%, transparent 68%);
    mix-blend-mode: screen;
    will-change: transform;
}
[data-theme="light"] #fx-spotlight {
    background: radial-gradient(circle, rgba(124,58,237,.12), rgba(8,145,178,.06) 38%, transparent 68%);
    mix-blend-mode: multiply;
}
#fx-spotlight.on { opacity: 1; }

/* Revelado con blur al hacer scroll / aparecer */
[data-reveal] {
    opacity: 0;
    transform: translateY(26px) scale(.985);
    filter: blur(10px);
    transition: opacity .85s var(--ease-out), transform .85s var(--ease-out), filter .85s var(--ease-out);
}
[data-reveal].revealed { opacity: 1; transform: none; filter: blur(0); }

/* Tilt 3D sutil (controlado por app.js) */
.tilt { transform-style: preserve-3d; will-change: transform; }

/* Transición circular entre temas (View Transitions API) */
::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }

/* ---------- 15. Responsive ---------- */
@media (max-width: 640px) {
    .card { padding: 22px; border-radius: 24px; }
    .nav-content { width: 94%; }
    .brand span { font-size: 15px; }
    .btn::before { display: none; } /* sin barrido en touch */
}
