﻿/* =========================================
   THEME: METAL ADMIN LOGIN (Glassmorphism & Plasma Blob)
   ========================================= */

@keyframes gradientBG {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

body {
    background: linear-gradient(-45deg, #020403, #08120a, #040a06, #000000);
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
    height: 100vh !important; /* Forzado a 100vh para evitar saltos de SweetAlert */
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Inter', sans-serif;
    color: #d0d0d0;
    overflow: hidden !important; /* Cero saltos */
    margin: 0;
    padding: 0 !important;
}

/* --- ANIMACIÓN TOXIC PLASMA BLOB --- */
#login-plasma-bg {
    position: fixed;
    top: 50%;
    left: 50%;
    width: 100vw;
    height: 100vh;
    transform: translate(-50%, -50%);
    z-index: -1;
    pointer-events: none;
    overflow: hidden;
}

    #login-plasma-bg svg {
        width: 150vw;
        height: 150vh;
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
    }

@keyframes plasma-spin {
    0% {
        transform: translate(100px, 100px) rotate(0deg) scale(1);
    }

    50% {
        transform: translate(100px, 100px) rotate(180deg) scale(1.3);
    }

    100% {
        transform: translate(100px, 100px) rotate(360deg) scale(1);
    }
}

@keyframes plasma-spin-reverse {
    0% {
        transform: translate(100px, 100px) rotate(360deg) scale(1.1);
    }

    50% {
        transform: translate(100px, 100px) rotate(180deg) scale(0.9);
    }

    100% {
        transform: translate(100px, 100px) rotate(0deg) scale(1.1);
    }
}

.plasma-blob-1 {
    animation: plasma-spin 25s ease-in-out infinite;
    transform-origin: center;
}

.plasma-blob-2 {
    animation: plasma-spin-reverse 35s ease-in-out infinite;
    transform-origin: center;
}

/* --- MAIN CARD (GLASSMORPHISM) --- */
.main-card {
    display: flex;
    width: 950px;
    height: 700px; /* <--- Altura original mantenida */
    background: rgba(10, 10, 10, 0.65);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(0, 230, 118, 0.25);
    border-radius: 20px;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.9), inset 0 0 20px rgba(0, 230, 118, 0.05);
    overflow: hidden;
    position: relative;
    z-index: 1;
}

/* Lado Izquierdo (Imagen HD) */
.left-side {
    width: 50%;
    position: relative;
    background-color: #050505;
    overflow: hidden;
}

.left-side-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: none;
}

/* Lado Derecho (Formulario) */
.right-side {
    width: 50%;
    padding: 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: rgba(5, 5, 5, 0.4);
    position: relative;
}

    .right-side::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 4px;
        background: #00e676;
        box-shadow: 0 0 15px rgba(0, 230, 118, 0.8);
    }

/* --- TIPOGRAFÍA --- */
h2 {
    color: #fff;
    font-weight: 900;
    font-family: 'Montserrat', sans-serif;
    font-size: 2.4rem;
    text-transform: uppercase;
    margin-bottom: 5px;
    text-shadow: 0 0 15px rgba(0, 230, 118, 0.4);
    letter-spacing: 1.5px;
}

.subtitle {
    color: #aaa;
    font-size: 0.95rem;
    margin-bottom: 40px;
    letter-spacing: 1px;
    font-weight: 600;
}

/* --- INPUTS --- */
.input-wrapper {
    position: relative;
    width: 100%;
    margin-bottom: 25px;
}

    .input-wrapper i.bi:not(.pass-toggle) {
        position: absolute;
        left: 20px;
        top: 50%;
        transform: translateY(-50%);
        color: #00e676;
        font-size: 1.2rem;
        z-index: 2;
        pointer-events: none;
        text-shadow: 0 0 8px rgba(0, 230, 118, 0.5);
    }

.form-control-custom {
    width: 100%;
    height: 55px;
    background: rgba(5, 5, 5, 0.8);
    border: 1px solid #333;
    border-radius: 8px;
    padding-left: 55px;
    padding-right: 20px;
    color: #ffffff !important; /* <--- TEXTO SIEMPRE BLANCO */
    font-size: 1rem;
    outline: none;
    transition: all 0.3s ease;
}

    .form-control-custom:focus {
        background: #000000;
        border-color: #00e676;
        box-shadow: 0 0 15px rgba(0, 230, 118, 0.2);
        color: #ffffff !important;
    }

    /* --- FIX AUTOCOMPLETADO BLINDADO PARA NAVEGADORES --- */
    .form-control-custom:-webkit-autofill,
    .form-control-custom:-webkit-autofill:hover,
    .form-control-custom:-webkit-autofill:focus,
    .form-control-custom:-webkit-autofill:active {
        -webkit-box-shadow: 0 0 0 1000px #050505 inset !important; /* Fondo negro absoluto */
        -webkit-text-fill-color: #ffffff !important; /* FUERZA TEXTO BLANCO */
        color: #ffffff !important;
        transition: background-color 5000s ease-in-out 0s; /* Evita parpadeos de color */
    }

/* Ojo Ver Contraseña */
.pass-toggle {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: #555;
    cursor: pointer;
    z-index: 3;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    pointer-events: auto !important;
}

    .pass-toggle:hover, .pass-toggle.active {
        color: #00e676;
        text-shadow: 0 0 8px rgba(0, 230, 118, 0.5);
    }

/* --- BOTONES Y LINKS --- */
.btn-login {
    width: 100%;
    height: 55px;
    background: linear-gradient(135deg, #00b35c 0%, #006633 100%);
    color: #fff;
    border: 1px solid #00e676;
    border-radius: 8px;
    font-weight: 800;
    font-size: 1.05rem;
    font-family: 'Montserrat', sans-serif;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-top: 15px;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    cursor: pointer;
    box-shadow: 0 0 15px rgba(0, 230, 118, 0.3), inset 0 0 10px rgba(0, 230, 118, 0.2);
}

    .btn-login:hover {
        transform: translateY(-3px);
        box-shadow: 0 0 25px rgba(0, 230, 118, 0.6), inset 0 0 15px rgba(255, 255, 255, 0.2);
        border-color: #55ff99;
        background: linear-gradient(135deg, #00e676 0%, #00a352 100%);
        color: #000;
    }

.links-wrapper {
    width: 100%;
    margin-top: 25px;
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    font-weight: 600;
}

    .links-wrapper a {
        text-decoration: none;
        transition: all 0.3s ease;
    }

.link-forgot {
    color: #888;
}

    .link-forgot:hover {
        color: #fff;
        text-shadow: 0 0 8px rgba(255,255,255,0.3);
    }

.link-register {
    color: #00e676;
    font-weight: 800;
}

    .link-register:hover {
        color: #55ff99;
        text-shadow: 0 0 10px rgba(0, 230, 118, 0.5);
    }

.footer-text {
    margin-top: auto;
    font-size: 0.75rem;
    color: #555;
}

/* --- MODAL RECUPERAR --- */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.85);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.modal-box {
    background: rgba(10, 15, 12, 0.95);
    padding: 40px;
    width: 450px;
    border: 1px solid rgba(0, 230, 118, 0.3);
    border-top: 4px solid #00e676;
    border-radius: 16px;
    text-align: center;
    box-shadow: 0 0 50px rgba(0, 230, 118, 0.15);
}

.modal-title {
    color: #fff;
    font-family: 'Montserrat', sans-serif;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
    font-weight: 800;
}

.modal-desc {
    color: #aaa;
    font-size: 0.95rem;
    margin-bottom: 30px;
    font-weight: 600;
}

.loading-text {
    color: #00e676;
    margin-top: 20px;
    font-weight: bold;
    font-size: 0.95rem;
    text-shadow: 0 0 8px rgba(0,230,118,0.5);
}

.btn-cancelar-modal {
    background: transparent;
    border: none;
    color: #888;
    margin-top: 25px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

    .btn-cancelar-modal:hover {
        color: #ff4d4d;
        text-shadow: 0 0 10px rgba(255, 77, 77, 0.5);
    }

/* --- SWEETALERT OVERRIDES (Evita saltos del body) --- */
div:where(.swal2-container) {
    z-index: 20000 !important;
}

div:where(.swal2-popup) {
    background: rgba(15, 15, 15, 0.95) !important;
    backdrop-filter: blur(15px) !important;
    -webkit-backdrop-filter: blur(15px) !important;
    border: 1px solid #00e676 !important;
    color: #e0e0e0 !important;
    border-radius: 12px !important;
    box-shadow: 0 0 40px rgba(0,0,0,0.9), inset 0 0 15px rgba(0, 230, 118, 0.1) !important;
    font-family: 'Montserrat', sans-serif !important;
}

div:where(.swal2-title) {
    color: #fff !important;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 900 !important;
}

div:where(.swal2-html-container) {
    color: #bbb !important;
    font-weight: 500 !important;
    font-family: 'Inter', sans-serif !important;
}

div:where(.swal2-confirm) {
    background-color: #00e676 !important;
    color: #000 !important;
    box-shadow: 0 0 15px rgba(0, 230, 118, 0.3) !important;
    border: none !important;
    font-weight: 800 !important;
    border-radius: 6px !important;
    padding: 12px 25px !important;
    text-transform: uppercase;
}

    div:where(.swal2-confirm):hover {
        background-color: #55ff99 !important;
        transform: translateY(-2px);
        box-shadow: 0 0 25px rgba(0, 230, 118, 0.6) !important;
    }

/* --- RESPONSIVE --- */
@media (max-width: 900px) {
    .left-side {
        display: none;
    }

    .right-side {
        width: 100%;
        padding: 30px;
        background: transparent;
    }

    .main-card {
        width: 90%;
        height: auto;
        min-height: 550px;
    }
}
