/* ===============================
   FONTS
================================ */

@import url('https://fonts.googleapis.com/css2?family=Libre+Franklin:wght@300;400;500;600&display=swap');

@font-face {
    font-family: 'Capitanejo';
    src: url('/static/fonts/Capitanejo-Regular.woff2') format('woff2');
}


/* ===============================
   VARIABLES
================================ */

:root {
    --color-primary: #17233d;   /* Azul corporativo */
    --color-primary-light: #24365a;
    --color-primary-dark: #0f1a31;

    --color-bg: #17233d;
    --color-white: #ffffff;
    --color-black: #000000;
    --color-muted: #9aa3b2;

    --color-input: rgba(255,255,255,0.08);
    --color-border: rgba(255,255,255,0.15);

    --font-title: 'Capitanejo', serif;
    --font-body: 'Libre Franklin', sans-serif;

    --radius: 12px;
}


/* ===============================
   FONDO
================================ */
*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-body);
    color: var(--color-white);
    overflow: hidden;
    position: relative;

    background: radial-gradient(circle at 50% 50%, rgba(255,255,255,0.08), transparent 70%),
                linear-gradient(-45deg,
                    var(--color-primary-dark),
                    var(--color-primary),
                    #1f2f4d,
                    var(--color-primary-dark)
                );

    background-size: 400% 400%;
    animation: bgMove 10s ease-in-out infinite;
}

@keyframes bgMove {
    0% {background-position: 0% 50%}
    50% {background-position: 100% 50%}
    100% {background-position: 0% 50%}
}


/* ===============================
   PARTÍCULAS (MARIPOSAS)
================================ */

#tsparticles {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}


/* ===============================
   CARD LOGIN
================================ */

.login-container {
    width: 360px;
    padding: 2.5rem;
    border-radius: 22px;
    text-align: center;

    background: linear-gradient(
        180deg,
        rgba(36, 54, 90, 0.95),
        rgba(15, 26, 49, 0.95)
    );

    box-shadow:
        0 0 0 1px rgba(255, 253, 253, 0.05),
        0 15px 40px rgba(255, 255, 255, 0.6);

    backdrop-filter: blur(14px);
    position: relative;
    z-index: 2;

    animation: fadeIn .8s ease both;
}

@keyframes fadeIn {
    from {opacity:0; transform:translateY(-16px)}
    to {opacity:1; transform:translateY(0)}
}


/* ===============================
   LOGO
================================ */

.logo {
    margin-bottom: 1rem;
    display: flex;
    justify-content: center;
}

.logo-frame {
    padding: 10px;
    border-radius: 18px;
    background: rgba(255,255,255,0.05);
    box-shadow: 0 0 25px rgba(255,255,255,0.08);
}

.logo img {
    width: 130px;
}


/* ===============================
   TITULO
================================ */

h2 {
    font-family: var(--font-title);
    margin: 1rem 0 1.2rem;
    color: var(--color-white);
}


/* ===============================
   FORMULARIO
================================ */

.form-group {
    margin-bottom: 1rem;
    text-align: left;
}

.form-group label {
    font-size: .85rem;
    color: var(--color-muted);
    display: block;
    margin-bottom: .35rem;
}

.form-group input {
    width: 100%;
    padding: .85rem .95rem;
    border-radius: var(--radius);
    border: 1px solid var(--color-border);
    background: var(--color-input);
    color: var(--color-white);
    font-size: 1rem;
    outline: none;
    transition: .2s;
}

.form-group input::placeholder {
    color: #7f8aa3;
}

.form-group input:focus {
    border-color: rgba(255,255,255,0.4);
    box-shadow: 0 0 0 3px rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.12);
}










/* ===============================
   MOSTRAR / OCULTAR CONTRASEÑA
================================ */

.password-wrapper {
    position: relative;
    width: 100%;
}

.password-wrapper input {
    width: 100%;
    padding-right: 48px;
}


/* Botón del ojo */

.password-toggle {
    position: absolute;

    top: 50%;
    right: 9px;

    transform: translateY(-50%);

    width: 34px;
    height: 34px;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 0;

    border: none;
    border-radius: 8px;

    background: transparent;
    color: var(--color-muted);

    cursor: pointer;

    transition:
        color .2s ease,
        background .2s ease;
}


.password-toggle:hover {
    color: var(--color-white);
    background: rgba(255,255,255,0.08);
}


.password-toggle:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: 1px;
}


/* Iconos */

.password-toggle svg {
    width: 20px;
    height: 20px;

    pointer-events: none;
}


/* Ocultamos inicialmente el ojo tachado */

.password-toggle .icon-eye-off {
    display: none;
}


/* Contraseña visible */

.password-toggle.is-visible .icon-eye {
    display: none;
}

.password-toggle.is-visible .icon-eye-off {
    display: block;
}










/* ===============================
   BOTÓN
================================ */

.btn-login {
    width: 100%;
    padding: 1rem;
    margin-top: 1rem;
    border: none;
    cursor: pointer;

    border-radius: 14px;
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: .3px;

    color: var(--color-white);

    background: linear-gradient(
        180deg,
        #3b82f6,
        #1d4ed8,
        #1e40af
    );

    box-shadow:
        0 10px 25px rgba(0,0,0,0.5),
        inset 0 1px 2px rgba(255,255,255,0.2);

    transition: .2s;
}

.btn-login:hover {
    transform: translateY(-2px);
    filter: brightness(1.1);
}

.btn-login:active {
    transform: scale(0.98);
}


/* ===============================
   LINKS
================================ */

.extra-links {
    margin-top: 1rem;
    font-size: .85rem;
}

.extra-links a {
    color: #93c5fd;
    text-decoration: none;
}

.extra-links a:hover {
    text-decoration: underline;
}


/* ===============================
   ERRORES
================================ */

.error-container {
    padding: 12px 16px;
    margin-bottom: 1.5rem;
    border-radius: 12px;

    background: rgba(239,68,68,0.1);
    border: 1px solid rgba(239,68,68,0.4);
    color: #fca5a5;

    font-size: 0.9rem;
}