/* ===============================
   RESET
================================ */

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}


/* ===============================
   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;
    --color-primary-light: #24365a;
    --color-primary-dark: #0f1a31;

    --color-white: #ffffff;
    --color-muted: #9aa3b2;

    --color-input: rgba(255,255,255,0.08);
    --color-border: rgba(255,255,255,0.15);

    --color-error-bg: rgba(239,68,68,0.1);
    --color-error-border: rgba(239,68,68,0.4);
    --color-error-text: #fca5a5;

    --radius: 12px;

    --font-title: 'Capitanejo', serif;
    --font-body: 'Libre Franklin', sans-serif;
}


/* ===============================
   FONDO
================================ */

body {
    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.06), transparent 70%),
                linear-gradient(-45deg,
                    var(--color-primary-dark),
                    var(--color-primary),
                    #1f2f4d,
                    var(--color-primary-dark)
                );

    background-size: 400% 400%;
    animation: bgMove 12s ease-in-out infinite;
}

@keyframes bgMove {
    0% {background-position: 0% 50%}
    50% {background-position: 100% 50%}
    100% {background-position: 0% 50%}
}


/* ===============================
   PARTICULAS
================================ */

#tsparticles {
    position: absolute;
    inset: 0;
    z-index: 0;
}


/* ===============================
   CARD
================================ */

.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);
}


/* ===============================
   TEXTO INFO
================================ */

.forgot-pass {
    font-size: 0.85rem;
    color: var(--color-muted);
    line-height: 1.4;
}

.forgot-pass a {
    color: #93c5fd;
    text-decoration: none;
}

.forgot-pass a:hover {
    text-decoration: underline;
}


/* ===============================
   FORM
================================ */

.form-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.form-group label {
    font-size: 0.8rem;
    color: var(--color-muted);
}

.form-group input {
    padding: 0.7rem 0.9rem;
    border-radius: 10px;
    border: 1px solid var(--color-border);

    background: var(--color-input);
    color: var(--color-white);

    font-size: 0.95rem;
}

.form-group input:focus {
    border-color: rgba(255,255,255,0.35);
    background: rgba(255,255,255,0.12);
    box-shadow: 0 0 0 2px rgba(59,130,246,0.25);
}


/* ===============================
   BOTÓN
================================ */

.btn-login {
    margin-top: 0.8rem;
    padding: 0.85rem;

    border-radius: 12px;
    border: none;
    cursor: pointer;

    font-weight: 600;

    color: white;

    background: linear-gradient(
        180deg,
        #3b82f6,
        #2563eb,
        #1e40af
    );

    box-shadow:
        0 8px 20px rgba(0,0,0,0.5);
}

.btn-login:hover {
    transform: translateY(-1px);
}


/* ===============================
   LINKS
================================ */

.extra-links {
    text-align: center;
    margin-top: 0.5rem;
}

.extra-links a {
    font-size: 0.8rem;
    color: #93c5fd;
}


/* ===============================
   ERRORES
================================ */

.error-container {
    padding: 10px;
    border-radius: 10px;

    background: var(--color-error-bg);
    border: 1px solid var(--color-error-border);

    color: var(--color-error-text);
    font-size: 0.85rem;
}


/* ===============================
   MODAL
================================ */

.modal-backdrop {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;

    background: rgba(2,6,23,0.7);
    z-index: 9999;
}

.modal-show {
    display: flex !important;
}

.modal-card {
    width: 360px;
    padding: 1.2rem;

    border-radius: 12px;

    background: var(--color-primary);
    color: white;

    box-shadow: 0 10px 30px rgba(0,0,0,0.6);
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 1rem;
}

.modal-primary {
    background: #2563eb;
    border: none;
    padding: 0.5rem 0.8rem;
    border-radius: 8px;
    color: white;
    cursor: pointer;
}

.modal-secondary {
    background: #ef4444;
    border: none;
    padding: 0.5rem 0.8rem;
    border-radius: 8px;
    color: white;
    cursor: pointer;
}