/* ===== 1) Variables y base ===== */
:root {
    --bg: #0b0f14;
    --grid: rgba(255, 255, 255, .03);
    --ink: #e5e7eb;
    --muted: #9aa4b2;
    --brand: #14e0c9;
    --accent: #f472b6;
    --line: #1e293b;
    --shadow: 0 10px 30px rgba(0, 0, 0, .35);
    --radius: 16px;
    --caret-speed: .9s;
}

/* Fondo con cuadrícula y gradientes */
html,
body {
    height: 100%
}

body {
    background:
        linear-gradient(to right, var(--grid) 1px, transparent 1px),
        linear-gradient(to bottom, var(--grid) 1px, transparent 1px),
        radial-gradient(60vw 60vh at 70% -20%, rgba(20, 224, 201, .10), transparent 60%),
        radial-gradient(40vw 40vh at -10% 110%, rgba(244, 114, 182, .08), transparent 70%),
        linear-gradient(var(--bg), var(--bg));
    background-size: 40px 40px, 40px 40px, auto, auto, auto;
    color: var(--ink);
}

/* ===== 2) Capas de fondo ===== */
/* Code-rain por debajo del pixel-trail */
#codeRain {
    position: fixed;
    inset: 0;
    z-index: -1;
    /* capa más baja de los dos */
    pointer-events: none;
    opacity: .60;
    mix-blend-mode: screen;
    /* compatible */
}

/* Pixel-trail por encima del code-rain */
#pixelTrail {
    position: fixed;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    opacity: .70;
    /* ajusta si quieres más/menos */
    mix-blend-mode: screen;
}

/* Contenido por encima de ambos */
main.container {
    position: relative;
    z-index: 2
}

/* ===== 3) Tarjetas (los “cuadrados”) ===== */
.grid-cards {
    display: grid;
    gap: 18px;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.card {
    background: linear-gradient(180deg, rgba(13, 18, 32, .85), rgba(13, 18, 32, .65));
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 16px;
    display: grid;
    gap: 8px;
}

.card-title {
    font-weight: 800;
    letter-spacing: .02em
}

.card-text {
    color: var(--muted)
}

.btn-link {
    justify-self: start;
    color: var(--brand);
    text-decoration: none;
    border: 1px solid var(--brand);
    border-radius: .5rem;
    padding: .45rem .8rem;
}

.btn-link:hover {
    background: rgba(20, 224, 201, .08)
}

.btn-link.disabled {
    opacity: .6;
    pointer-events: none;
    border-color: #3a5164;
    color: #78929f
}

/* ===== 4) Modal (oculto por defecto) ===== */
.auth-backdrop {
    display: none;
    /* oculto hasta que agregues .show desde JS */
    position: fixed;
    inset: 0;
    z-index: 60;
    background: rgba(0, 0, 0, .6);
    backdrop-filter: blur(2px);
    align-items: center;
    justify-content: center;
}

.auth-backdrop.show {
    display: flex
}

.auth-panel {
    width: min(560px, calc(100% - 2rem));
    background: #0d1220;
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: var(--shadow);
    padding: 18px;
    color: var(--ink);
}

.auth-title {
    margin: 0 0 .25rem 0;
    font-weight: 800
}

.auth-title span {
    color: #faea3c
}

.auth-sub {
    margin: .25rem 0 1rem 0;
    color: var(--muted)
}

.auth-form {
    display: grid;
    gap: .75rem
}

.pass-wrap {
    display: flex;
    gap: .5rem;
    align-items: center
}

.toggle-pass {
    padding: .35rem .6rem;
    border: 1px solid var(--line);
    border-radius: .5rem;
    background: #111823;
    color: var(--ink)
}

.btn-primary {
    padding: .55rem .9rem;
    border-radius: .5rem;
    background: #14e0c9;
    color: #0b0f14;
    border: none;
    font-weight: 700;
    cursor: pointer
}

.btn-primary:hover {
    filter: brightness(1.05)
}

.hp {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden
}

.form-status {
    min-height: 1.2em;
    color: var(--muted);
    display: none;
    padding: .5rem;
    border-radius: .5rem;
    margin-top: .5rem;
    text-align: center;
}

.form-status.error {
    background: rgba(239, 68, 68, .1);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, .3);
}

.form-status.success {
    background: rgba(34, 197, 94, .1);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, .3);
}

/* Estilos para inputs */
.auth-form input[type="text"],
.auth-form input[type="password"] {
    padding: .65rem;
    border: 1px solid var(--line);
    border-radius: .5rem;
    background: #111823;
    color: var(--ink);
    font-size: 1rem;
}

.auth-form input[type="text"]:focus,
.auth-form input[type="password"]:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 2px rgba(20, 224, 201, .1);
}

.auth-form label {
    font-weight: 600;
    font-size: .9rem;
    color: var(--ink);
}

/* ===== 5) Typewriter del título ===== */
#monTitle {
    position: relative;
}

.caret {
    position: absolute;
    display: inline-block;
    width: 8px;
    height: 1.1em;
    background: var(--ink);
    animation: blink var(--caret-speed) steps(1, end) infinite;
}

@keyframes blink {
    50% {
        opacity: 0
    }
}

@media (prefers-reduced-motion:reduce) {

    #codeRain,
    #pixelTrail {
        display: none
    }

    .caret {
        animation: none
    }
}