@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700;900&family=Rajdhani:wght@300;400;600;700&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    font-family: 'Rajdhani', sans-serif;
}

body {
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(45deg, #0a0a23 0%, #1a1a4e 15%, #2a2a8e 30%, #1a4e8e 45%, #0e4d6b 60%, #2a8e5a 75%, #1a8e2a 90%, #0a4a0a 100%);
    background-size: 400% 400%;
    animation: gradientShift 10s ease infinite;
    position: relative;
    overflow: hidden;
}

/* Animación del fondo */
@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    25% { background-position: 100% 0%; }
    50% { background-position: 100% 100%; }
    75% { background-position: 0% 100%; }
    100% { background-position: 0% 50%; }
}

/* Partículas flotantes espectaculares */
body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(2px 2px at 20px 30px, #00ff88, transparent),
        radial-gradient(2px 2px at 40px 70px, #ff0080, transparent),
        radial-gradient(1px 1px at 90px 40px, #0080ff, transparent),
        radial-gradient(1px 1px at 130px 80px, #ffaa00, transparent),
        radial-gradient(2px 2px at 160px 30px, #aa00ff, transparent),
        radial-gradient(1px 1px at 200px 60px, #ff4040, transparent),
        radial-gradient(2px 2px at 250px 20px, #40ff40, transparent);
    background-repeat: repeat;
    background-size: 300px 150px;
    animation: particles 25s linear infinite;
    opacity: 0.7;
}

/* Efectos de circuito en el fondo */
body::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        linear-gradient(90deg, transparent 24%, rgba(0, 255, 136, 0.05) 25%, rgba(0, 255, 136, 0.05) 26%, transparent 27%, transparent 74%, rgba(0, 255, 136, 0.05) 75%, rgba(0, 255, 136, 0.05) 76%, transparent 77%, transparent),
        linear-gradient(0deg, transparent 24%, rgba(0, 128, 255, 0.05) 25%, rgba(0, 128, 255, 0.05) 26%, transparent 27%, transparent 74%, rgba(0, 128, 255, 0.05) 75%, rgba(0, 128, 255, 0.05) 76%, transparent 77%, transparent);
    background-size: 60px 60px;
    animation: circuit 40s linear infinite;
    opacity: 0.3;
}

@keyframes particles {
    0% { transform: translateY(100vh) rotate(0deg); opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { transform: translateY(-100vh) rotate(360deg); opacity: 0; }
}

@keyframes circuit {
    0% { background-position: 0 0, 0 0; }
    100% { background-position: 60px 60px, -60px -60px; }
}

/* Tarjeta de login limpia y elegante */
.contenedor {
    width: 420px;
    padding: 40px;
    background: rgba(15, 15, 25, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 
        0 25px 50px rgba(0, 0, 0, 0.5),
        0 0 30px rgba(255, 255, 255, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    position: relative;
    z-index: 10;
    animation: slideIn 0.8s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.imagen {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
    position: relative;
}

#imagensub {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: contain;
    filter: brightness(1.1) contrast(1.1);
    transition: all 0.3s ease;
}

#imagensub:hover {
    transform: scale(1.1);
    filter: brightness(1.3) contrast(1.2);
}

.formulario h2 {
    text-align: center;
    color: #ffffff;
    font-family: 'Orbitron', monospace;
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 35px;
    text-shadow: 0 2px 10px rgba(255, 255, 255, 0.3);
    letter-spacing: 3px;
}

.elemento {
    margin-bottom: 25px;
    position: relative;
}

.elemento label {
    display: block;
    color: #e0e0e0;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.elemento input[type="text"],
.elemento input[type="password"] {
    width: 100%;
    padding: 15px 20px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    color: #ffffff;
    font-size: 16px;
    font-weight: 400;
    font-family: 'Rajdhani', sans-serif;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}

.elemento input[type="text"]:focus,
.elemento input[type="password"]:focus {
    outline: none;
    border-color: #00aaff;
    background: rgba(0, 170, 255, 0.1);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 170, 255, 0.2);
}

.elemento input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.elemento input[type="submit"] {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #0066cc 0%, #0052a3 100%);
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 16px;
    font-weight: 600;
    font-family: 'Rajdhani', sans-serif;
    text-transform: uppercase;
    letter-spacing: 2px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 20px;
    box-shadow: 0 4px 15px rgba(0, 102, 204, 0.3);
}

.elemento input[type="submit"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 102, 204, 0.4);
    background: linear-gradient(135deg, #0052a3 0%, #003d7a 100%);
}

.elemento input[type="submit"]:active {
    transform: translateY(0);
}

.olvide {
    display: block;
    width: 100%;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    color: rgba(255, 255, 255, 0.7);
    padding: 12px;
    font-size: 14px;
    font-weight: 500;
    font-family: 'Rajdhani', sans-serif;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 15px;
    text-decoration: none;
}

.olvide:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.4);
    color: #ffffff;
    transform: translateY(-2px);
}

/* Mensajes de error y éxito */
.error-message {
    background: rgba(255, 60, 60, 0.15);
    border: 1px solid rgba(255, 60, 60, 0.4);
    border-radius: 12px;
    color: #ff6060;
    padding: 15px;
    margin-bottom: 20px;
    text-align: center;
    font-weight: 600;
    backdrop-filter: blur(10px);
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-8px); }
    75% { transform: translateX(8px); }
}

.success-message {
    background: rgba(60, 255, 60, 0.15);
    border: 1px solid rgba(60, 255, 60, 0.4);
    border-radius: 12px;
    color: #60ff60;
    padding: 15px;
    margin-bottom: 20px;
    text-align: center;
    font-weight: 600;
    backdrop-filter: blur(10px);
    animation: glow 1s ease-in-out;
}

@keyframes glow {
    0% { box-shadow: 0 0 5px rgba(60, 255, 60, 0.3); }
    50% { box-shadow: 0 0 20px rgba(60, 255, 60, 0.6); }
    100% { box-shadow: 0 0 5px rgba(60, 255, 60, 0.3); }
}

/* Efecto matrix rain */
.matrix-rain {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    background: 
        linear-gradient(0deg, transparent 98%, rgba(0, 255, 136, 0.1) 100%);
    background-size: 20px 100px;
    animation: matrixRain 15s linear infinite;
    opacity: 0.3;
}

@keyframes matrixRain {
    0% { background-position: 0 -100px; }
    100% { background-position: 0 100vh; }
}

/* Responsive */
@media (max-width: 480px) {
    .contenedor {
        width: 95%;
        margin: 10px;
        padding: 30px 25px;
    }
    
    .formulario h2 {
        font-size: 24px;
        letter-spacing: 2px;
    }
    
    #imagensub {
        width: 70px;
        height: 70px;
    }
    
    .elemento input[type="text"],
    .elemento input[type="password"] {
        padding: 12px 15px;
        font-size: 15px;
    }
    
    .elemento input[type="submit"] {
        padding: 14px;
        font-size: 15px;
    }
}
