/* Variables CSS */
:root {
    --primary-color: #e10600;
    --secondary-color: #00d2be;
    --accent-color: #ff8700;
    --dark-color: #121212;
    --light-color: #ffffff;
    --neon-glow: 0 0 10px rgba(225, 6, 0, 0.7), 0 0 20px rgba(225, 6, 0, 0.5), 0 0 30px rgba(225, 6, 0, 0.3);
    --teal-glow: 0 0 10px rgba(0, 210, 190, 0.7), 0 0 20px rgba(0, 210, 190, 0.5), 0 0 30px rgba(0, 210, 190, 0.3);
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    --border-radius: 12px;
}

/* Reset y estilos generales */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Rajdhani', sans-serif;
    background-color: var(--dark-color);
    color: var(--light-color);
    line-height: 1.6;
    height: 100vh;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    perspective: 1000px;
    position: relative;
}

/* Video de fondo */
video {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -100;
    object-fit: cover;
}

/* Contenedor principal */
.container {
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
}

/* Tarjeta de login futurista */
.login-container {
    width: 90%;
    max-width: 480px;
    position: relative;
    transform-style: preserve-3d;
    perspective: 1000px;
}

.login-card {
    width: 100%;
    background: rgba(18, 18, 18, 0.8);
    backdrop-filter: blur(20px);
    border-radius: var(--border-radius);
    padding: 40px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5);
    position: relative;
    z-index: 1;
    overflow: hidden;
    transform: translateZ(0);
    transition: transform 0.5s ease;
}

.login-card:hover {
    transform: translateZ(20px);
}

/* Efecto de borde brillante */
.login-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: var(--border-radius);
    padding: 2px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color), var(--accent-color), var(--primary-color));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    background-size: 300% 300%;
    animation: borderAnimation 8s linear infinite;
}

@keyframes borderAnimation {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* Logo y título */
.login-header {
    text-align: center;
    margin-bottom: 40px;
    position: relative;
}

.login-header .logo-container {
    position: relative;
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
}

.login-header .logo {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 0 8px rgba(225, 6, 0, 0.7));
    animation: pulseLogo 2s infinite alternate;
}

@keyframes pulseLogo {
    0% {
        filter: drop-shadow(0 0 5px rgba(225, 6, 0, 0.5));
        transform: scale(1);
    }
    100% {
        filter: drop-shadow(0 0 12px rgba(225, 6, 0, 0.8));
        transform: scale(1.05);
    }
}

.login-header h1 {
    font-family: 'Orbitron', sans-serif;
    font-size: 32px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 10px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-fill-color: transparent;
}

.login-header p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 16px;
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* Formulario futurista */
.login-form {
    position: relative;
    z-index: 1;
}

.form-group {
    position: relative;
    margin-bottom: 30px;
}

.form-group input {
    width: 100%;
    padding: 15px 15px 15px 50px;
    background: rgba(255, 255, 255, 0.05);
    border: none;
    border-radius: var(--border-radius);
    color: var(--light-color);
    font-family: 'Rajdhani', sans-serif;
    font-size: 16px;
    letter-spacing: 1px;
    transition: var(--transition);
}

.form-group input:focus {
    outline: none;
    box-shadow: 0 0 0 2px var(--secondary-color);
    background: rgba(255, 255, 255, 0.1);
}

.form-group i {
    position: absolute;
    top: 50%;
    left: 15px;
    transform: translateY(-50%);
    color: var(--secondary-color);
    font-size: 20px;
    transition: var(--transition);
}

.form-group input:focus ~ i {
    color: var(--light-color);
    text-shadow: var(--teal-glow);
}

.form-group .input-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--secondary-color), var(--primary-color));
    transition: var(--transition);
}

.form-group input:focus ~ .input-bar,
.form-group input:not(:placeholder-shown) ~ .input-bar {
    width: 100%;
}

/* Botón de inicio de sesión futurista */
.login-btn {
    position: relative;
    width: 100%;
    padding: 15px;
    margin-top: 20px;
    background: linear-gradient(135deg, var(--primary-color), #ff3300);
    color: var(--light-color);
    border: none;
    border-radius: var(--border-radius);
    font-family: 'Orbitron', sans-serif;
    font-size: 16px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    cursor: pointer;
    overflow: hidden;
    transition: var(--transition);
    box-shadow: 0 5px 15px rgba(225, 6, 0, 0.3);
}

.login-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    transition: var(--transition);
}

.login-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(225, 6, 0, 0.5);
}

.login-btn:hover::before {
    left: 100%;
    transition: 0.7s;
}

/* Efecto de pulso en el botón */
.login-btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: var(--border-radius);
    background: linear-gradient(135deg, var(--primary-color), #ff3300);
    opacity: 0;
    z-index: -1;
    animation: buttonPulse 2s infinite;
}

@keyframes buttonPulse {
    0% {
        opacity: 0.5;
        transform: scale(1);
    }
    50% {
        opacity: 0;
        transform: scale(1.3);
    }
    100% {
        opacity: 0;
        transform: scale(1.5);
    }
}

/* Semáforo de F1 */
.f1-lights {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 30px 0 20px;
}

.light-dot {
    width: 15px;
    height: 15px;
    background-color: #333;
    border-radius: 50%;
    box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.5);
    transition: all 0.3s ease;
}

/* Animación cuando se pasa el cursor sobre el botón */
.login-btn:hover ~ .f1-lights .light-dot {
    background-color: #ff0000;
    box-shadow: 0 0 10px 5px rgba(255, 0, 0, 0.5);
    animation: lightSequence 1s forwards;
}

@keyframes lightSequence {
    0%, 20% {
        background-color: #ff0000;
    }
    80%, 100% {
        background-color: #00ff00;
        box-shadow: 0 0 10px 5px rgba(0, 255, 0, 0.5);
    }
}

/* Retrasos para la secuencia de luces */
.login-btn:hover ~ .f1-lights .light-dot:nth-child(1) {
    animation-delay: 0s;
}
.login-btn:hover ~ .f1-lights .light-dot:nth-child(2) {
    animation-delay: 0.1s;
}
.login-btn:hover ~ .f1-lights .light-dot:nth-child(3) {
    animation-delay: 0.2s;
}
.login-btn:hover ~ .f1-lights .light-dot:nth-child(4) {
    animation-delay: 0.3s;
}
.login-btn:hover ~ .f1-lights .light-dot:nth-child(5) {
    animation-delay: 0.4s;
}

/* Enlaces adicionales */
.login-links {
    display: flex;
    justify-content: space-between;
    margin-top: 25px;
    font-size: 14px;
}

.login-links a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: var(--transition);
    position: relative;
    padding: 5px 0;
}

.login-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 1px;
    background: linear-gradient(90deg, var(--secondary-color), var(--primary-color));
    transition: var(--transition);
}

.login-links a:hover {
    color: var(--light-color);
}

.login-links a:hover::after {
    width: 100%;
}

/* Separador */
.separator {
    display: flex;
    align-items: center;
    margin: 30px 0;
}

.separator .line {
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
}

.separator .text {
    padding: 0 15px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Botones de redes sociales */
.social-login {
    display: flex;
    justify-content: center;
    gap: 20px;
}

.social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.7);
    font-size: 20px;
    transition: var(--transition);
    border: none;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.social-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 50%;
    padding: 2px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: var(--transition);
}

.social-btn:hover {
    transform: translateY(-3px);
    color: var(--light-color);
}

.social-btn:hover::before {
    opacity: 1;
}

/* Carro de F1 futurista */
.f1-car {
    position: absolute;
    top: 50%;
    left: -200px; /* Inicialmente fuera de la pantalla */
    width: 200px;
    height: 70px;
    transform: translateY(-50%);
    z-index: 10;
    transition: left 0s;
    pointer-events: none;
}

.car-body {
    position: absolute;
    width: 140px;
    height: 35px;
    background: linear-gradient(135deg, var(--primary-color), #ff3300);
    border-radius: 10px 30px 5px 5px;
    top: 15px;
    left: 30px;
    box-shadow: 0 5px 15px rgba(225, 6, 0, 0.5);
}

.car-cockpit {
    position: absolute;
    width: 40px;
    height: 15px;
    background-color: #000;
    border-radius: 5px;
    top: 8px;
    left: 80px;
}

.car-front-wing {
    position: absolute;
    width: 40px;
    height: 10px;
    background: linear-gradient(90deg, #ddd, #fff);
    border-radius: 5px;
    top: 25px;
    left: 150px;
}

.car-rear-wing {
    position: absolute;
    width: 30px;
    height: 20px;
    background: linear-gradient(135deg, var(--primary-color), #ff3300);
    top: 5px;
    left: 20px;
}

.car-wheel {
    position: absolute;
    width: 30px;
    height: 30px;
    background-color: #000;
    border-radius: 50%;
    border: 5px solid #333;
}

.car-wheel.front {
    top: 30px;
    left: 130px;
}

.car-wheel.rear {
    top: 30px;
    left: 40px;
}

/* Efecto de neón para el carro */
.car-glow {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    filter: blur(15px);
    opacity: 0.5;
    background: var(--primary-color);
    border-radius: 50%;
    transform: scale(0.7);
}

/* Animación del carro cuando se activa */
#login-form:target ~ .f1-car {
    left: calc(100% + 200px); /* Mueve el carro fuera de la pantalla por la derecha */
    transition: left 1.5s cubic-bezier(0.1, 0.7, 0.1, 1);
}

/* Efecto de estela para el carro */
.car-trail {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s;
}

#login-form:target ~ .f1-car .car-trail {
    opacity: 1;
}

.trail-particle {
    position: absolute;
    width: 5px;
    height: 5px;
    background-color: var(--primary-color);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--primary-color);
    opacity: 0;
}

#login-form:target ~ .f1-car .trail-particle {
    animation: trailFade 1s forwards;
}

@keyframes trailFade {
    0% {
        opacity: 0.7;
        transform: scale(1);
    }
    100% {
        opacity: 0;
        transform: scale(0.5) translateX(-100px);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .login-card {
        padding: 30px;
    }

    .login-header h1 {
        font-size: 28px;
    }

    .f1-car {
        transform: translateY(-50%) scale(0.8);
    }
}

@media (max-width: 480px) {
    .login-card {
        padding: 25px 20px;
    }

    .login-header h1 {
        font-size: 24px;
    }

    .login-header .logo-container {
        width: 60px;
        height: 60px;
    }

    .f1-car {
        transform: translateY(-50%) scale(0.6);
    }

    .social-login {
        gap: 15px;
    }

    .social-btn {
        width: 45px;
        height: 45px;
        font-size: 18px;
    }
}