:root {
    --ts-bg-main: #030617;
    --ts-bg-secondary: #0f172a;
    --ts-panel-bg: rgba(17, 24, 39, 0.66);
    --ts-panel-bg-strong: rgba(17, 24, 39, 0.92);

    --ts-accent: #e91414;
    --ts-accent-rgb: 233, 20, 20;
    --ts-accent-soft: rgba(233, 20, 20, 0.12);
    --ts-accent-border: rgba(233, 20, 20, 0.22);

    --ts-text: #ffffff;
    --ts-text-muted: rgba(255, 255, 255, 0.72);
    --ts-text-soft: rgba(255, 255, 255, 0.45);

    --ts-input-bg: rgba(17, 24, 39, 0.92);
    --ts-input-bg-focus: rgba(15, 23, 42, 0.98);
    --ts-soft-border: rgba(255, 255, 255, 0.06);
    --ts-soft-border-2: rgba(255, 255, 255, 0.04);

    --ts-radius-sm: 12px;
    --ts-radius-md: 14px;
    --ts-radius-lg: 22px;

    --ts-shadow-panel:
        0 20px 50px rgba(0, 0, 0, 0.28),
        0 0 0 1px rgba(255, 255, 255, 0.015) inset;

    --ts-shadow-modal: 0 20px 60px rgba(0, 0, 0, 0.45);
    --ts-shadow-button: 0 8px 25px rgba(var(--ts-accent-rgb), 0.12);
}

html,
body {
    overflow-x: hidden;
    background: var(--ts-bg-main) !important;
}

body.form {
    background: var(--ts-bg-main) !important;
    cursor: none;
}

/* ====== limpia fondos heredados ====== */
.auth-cover-bg-image {
    background: var(--ts-bg-main) !important;
    background-image: none !important;
}

.auth-overlay {
    display: none !important;
}

.auth-cover {
    background: var(--ts-bg-main) !important;
}

/* ====== cursor nativo oculto desktop ====== */
a,
button,
.btn,
input,
.input-group-text,
label,
.form-check-input,
.password-toggle1,
.password-toggle2 {
    cursor: none !important;
}

/* =========================
   CURSOR CUSTOM
========================= */
#cursor-canvas {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 9998;
}

.cursor-dot {
    position: fixed;
    left: 0;
    top: 0;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--ts-accent);
    box-shadow:
        0 0 10px rgba(var(--ts-accent-rgb), 0.95),
        0 0 18px rgba(var(--ts-accent-rgb), 0.55),
        0 0 28px rgba(var(--ts-accent-rgb), 0.28);
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
    transition:
        transform .06s linear,
        opacity .2s ease,
        width .18s ease,
        height .18s ease;
}

.cursor-dot.cursor-hover {
    width: 16px;
    height: 16px;
}

/* =========================
   HERO / LEFT
========================= */
.auth-cover .position-relative {
    max-width: 620px;
    margin: 0 auto;
}

.cyber-container {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: min(100%, 520px);
    margin: 12px auto 0;
    perspective: 1400px;
    isolation: isolate;
    border-radius: var(--ts-radius-lg);
    overflow: hidden;
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.04),
        0 10px 30px rgba(0, 0, 0, 0.22);
    background: rgba(255, 255, 255, 0.01);
}

.cyber-img {
    width: 100%;
    max-width: 520px;
    height: auto;
    display: block;
    position: relative;
    z-index: 2;
    border-radius: var(--ts-radius-lg);
    transform-style: preserve-3d;
    will-change: transform, filter;
    backface-visibility: hidden;
    filter:
        drop-shadow(0 0 18px rgba(var(--ts-accent-rgb), 0.16))
        drop-shadow(0 0 26px rgba(25, 65, 255, 0.08));
    transition:
        filter .25s ease,
        transform .25s ease;
}

.cyber-container:hover .cyber-img {
    filter:
        drop-shadow(0 0 24px rgba(var(--ts-accent-rgb), 0.24))
        drop-shadow(0 0 32px rgba(25, 65, 255, 0.12));
}

.glow {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 70%;
    height: 70%;
    transform: translate(-50%, -50%);
    border-radius: 999px;
    background: radial-gradient(circle,
            rgba(233, 20, 20, 0.12) 0%,
            rgba(233, 20, 20, 0.06) 35%,
            rgba(233, 20, 20, 0.02) 55%,
            rgba(233, 20, 20, 0) 75%);
    filter: blur(45px);
    z-index: 1;
    pointer-events: none;
    opacity: .55;
    transition:
        left .08s linear,
        top .08s linear,
        opacity .2s ease;
}

.frosted-glass {
    position: absolute;
    inset: 0;
    z-index: 3;
    pointer-events: none;
    border-radius: var(--ts-radius-lg);
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.015) 0%,
        rgba(255, 255, 255, 0.005) 100%
    );
    border: 1px solid rgba(255, 255, 255, 0.03);
    opacity: .12;
}

.cyber-container::after {
    display: none !important;
}

#hack {
    color: var(--ts-accent);
    font-weight: 700;
    letter-spacing: 3px;
    margin-top: 14px;
    min-height: 24px;
    text-shadow: 0 0 12px rgba(var(--ts-accent-rgb), 0.18);
}

/* =========================
   CARD / PANELS
========================= */
.card {
    background: var(--ts-panel-bg);
    border: 1px solid var(--ts-soft-border-2);
    box-shadow: var(--ts-shadow-panel);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border-radius: 18px;
}

.card-body h2,
.card-body p,
.form-label,
.form-check-label {
    color: var(--ts-text);
}

.card-body p,
.form-check-label {
    color: var(--ts-text-muted);
}

/* =========================
   INPUTS
========================= */
.beam-field {
    position: relative;
    border-radius: var(--ts-radius-sm);
}

.beam-field .input-group {
    position: relative;
    z-index: 2;
    border-radius: var(--ts-radius-sm);
}

.beam-input,
.beam-field .input-group-text {
    background: var(--ts-input-bg) !important;
    color: #fff !important;
    border: 1px solid var(--ts-soft-border) !important;
    box-shadow: none !important;
    position: relative;
    z-index: 2;
    transition:
        background .2s ease,
        border-color .2s ease,
        box-shadow .2s ease,
        color .2s ease;
}

.beam-input {
    border-radius: var(--ts-radius-sm) !important;
    min-height: 48px;
}

.beam-field .input-group .beam-input {
    border-top-right-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
}

.beam-field .input-group .input-group-text {
    border-top-left-radius: 0 !important;
    border-bottom-left-radius: 0 !important;
    min-width: 54px;
    justify-content: center;
}

.beam-input::placeholder {
    color: var(--ts-text-soft);
}

.beam-input:focus,
.beam-field .input-group-text:focus {
    outline: none !important;
    box-shadow: none !important;
}

.beam-line {
    position: absolute;
    inset: -2px;
    border-radius: var(--ts-radius-md);
    pointer-events: none;
    z-index: 1;
    opacity: 0;
    transition: opacity .2s ease;
}

.beam-line::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 2px;
    background: linear-gradient(
        90deg,
        transparent 0%,
        transparent 15%,
        rgba(233, 20, 20, 0.15) 20%,
        #e91414 28%,
        #ff5656 36%,
        #ff7a7a 42%,
        #e91414 50%,
        rgba(233, 20, 20, 0.15) 58%,
        transparent 70%,
        transparent 100%
    );
    background-size: 220% 100%;
    animation: snakeMove 2.1s linear infinite;
    -webkit-mask:
        linear-gradient(#000 0 0) content-box,
        linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    filter: drop-shadow(0 0 4px rgba(233, 20, 20, 0.25));
}

.beam-field:hover .beam-line,
.beam-field:focus-within .beam-line {
    opacity: 1;
}

.beam-field:hover .beam-input,
.beam-field:focus-within .beam-input,
.beam-field:hover .input-group-text,
.beam-field:focus-within .input-group-text {
    background: var(--ts-input-bg-focus) !important;
}

.beam-field:focus-within .beam-input {
    box-shadow: 0 0 12px rgba(233, 20, 20, 0.12) !important;
}

@keyframes snakeMove {
    0% {
        background-position: -220% 0;
    }
    100% {
        background-position: 220% 0;
    }
}

.password-toggle1 svg,
.password-toggle2 svg {
    width: 20px;
    height: 20px;
}

/* =========================
   BUTTONS
========================= */
.btn-secondary {
    background: linear-gradient(135deg, #1f2937, #111827);
    border: 1px solid var(--ts-accent-border);
    box-shadow: var(--ts-shadow-button);
    transition:
        all .25s ease,
        transform .2s ease;
}

.btn-secondary:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 12px 30px rgba(var(--ts-accent-rgb), 0.20);
    border-color: rgba(var(--ts-accent-rgb), 0.42);
}

.btn-secondary:focus:not(:disabled) {
    box-shadow:
        0 12px 30px rgba(var(--ts-accent-rgb), 0.20),
        0 0 0 3px rgba(var(--ts-accent-rgb), 0.18);
}

.btn-secondary:disabled {
    opacity: .55;
}

.btn-social-login {
    transition:
        transform .2s ease,
        box-shadow .2s ease,
        border-color .2s ease,
        color .2s ease;
    background: #f3f4f6 !important;
    color: #111827 !important;
    border: none !important;
    opacity: 1 !important;
    filter: none !important;
}

.btn-social-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(var(--ts-accent-rgb), 0.10);
    color: #111827 !important;
}

.text-warning {
    color: #ff8a65 !important;
}

/* =========================
   CHECKS / VALIDATION
========================= */
.form-check-input:checked {
    background-color: var(--ts-accent);
    border-color: var(--ts-accent);
}

.error {
    font-size: 12px;
    margin-top: 6px;
    display: block;
}

/* =========================
   MODALS
========================= */
.modal {
    z-index: 20000 !important;
}

.modal-backdrop {
    z-index: 19990 !important;
}

.modal-dialog,
.modal-content,
.modal-body,
.modal-footer {
    pointer-events: auto !important;
}

.modal-content {
    background: #0f172a !important;
    color: #fff !important;
    border: 1px solid rgba(255, 255, 255, 0.06) !important;
    box-shadow: var(--ts-shadow-modal);
    border-radius: 16px;
}

.modal .btn-light-dark {
    background: #111827 !important;
    color: #fff !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    opacity: 1 !important;
}

.modal .btn-light-dark:hover {
    background: #1f2937 !important;
    color: #fff !important;
}

/* =========================
   RESPONSIVE
========================= */
@media (max-width: 991.98px) {
    body.form {
        cursor: auto;
    }

    a,
    button,
    .btn,
    input,
    .input-group-text,
    label,
    .form-check-input,
    .password-toggle1,
    .password-toggle2 {
        cursor: pointer !important;
    }

    input {
        cursor: text !important;
    }

    #cursor-canvas,
    .cursor-dot {
        display: none !important;
    }
}