@import "style.css";

:root {
    --primary-color: #7b2cbf;
    --primary-dark: #5a108f;
    --primary-light: #e0aaff;
    --accent-color: rgb(242, 0, 255);
    --text-light: #f5f5f5;
    --text-dark: #333;
    --error-color: #ff3e3e;
    --success-color: #28a745;
    --bg-dark: #1a1a1a;
    --bg-darker: #121212;
}

.login-container {
    min-height: 110vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: linear-gradient(135deg, var(--bg-darker) 0%, var(--primary-dark) 100%);
    position: relative;
    overflow: hidden;
}

.login-container::before {
    content: "";
    position: absolute;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, transparent 20%, var(--bg-darker) 70%);
    top: -50%;
    left: -50%;
    opacity: 0.1;
    animation: backgroundAnimation 15s infinite linear;
    z-index: 0;
}

@keyframes backgroundAnimation {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.login-box {
    background: rgba(26, 26, 26, 0.9);
    padding: 40px;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(242, 0, 255, 0.3);
    width: 100%;
    max-width: 450px;
    position: relative;
    z-index: 1;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(242, 0, 255, 0.2);
    transition: transform 0.3s, box-shadow 0.3s;
    transform: translateY(-25px);
}

.login-box:hover {
    transform: translateY(-30px);
    box-shadow: 0 12px 40px rgba(242, 0, 255, 0.4);
}

.register-box {
    max-width: 800px;
    transform: translateY(0) !important;
}

.login-box h2 {
    text-align: center;
    margin-bottom: 30px;
    color: var(--text-light);
    font-size: 2rem;
    font-weight: 700;
    position: relative;
    padding-bottom: 10px;
}

.login-box h2::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    border-radius: 3px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 20px;
}

.input-group {
    margin-bottom: 20px;
    position: relative;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-light);
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.3s;
}

.input-group input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    font-size: 16px;
    background: rgba(255, 255, 255, 0.07);
    color: var(--text-light);
    transition: all 0.3s;
}

.input-group input:focus {
    outline: none;
    border-color: var(--accent-color);
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 15px rgba(242, 0, 255, 0.2);
}

.input-group input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.error-message {
    color: var(--error-color);
    margin-bottom: 15px;
    text-align: center;
    min-height: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s;
}

/* Modificación para el botón - eliminando la transición de hover conflictiva */
button {
    width: 100%;
    padding: 14px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    color: var(--text-light);
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

button::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: all 0.5s;
}

/* CORREGIDO: Hover solo cuando no está deshabilitado */
button:hover:not(:disabled) {
    background: linear-gradient(90deg, var(--primary-dark), var(--primary-color));
    box-shadow: 0 5px 15px rgba(123, 44, 191, 0.4);
}

button:hover:not(:disabled)::before {
    left: 100%;
}

/* Estado deshabilitado */
button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    background: linear-gradient(90deg, #666, #888) !important;
}

/* Agregar animación shake que faltaba */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.shake {
    animation: shake 0.5s ease-in-out;
}

.login-link {
    text-align: center;
    margin-top: 25px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.95rem;
}

.login-link a {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
}

.login-link a:hover {
    text-decoration: none;
    color: var(--primary-light);
    text-shadow: 0 0 8px rgba(242, 0, 255, 0.5);
}

.user-info {
    display: flex;
    gap: 15px;
    align-items: center;
}

.welcome-text {
    color: #d3d3d3;
    font-size: 15px;
}

/* Animación para los campos de formulario */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.input-group {
    animation: fadeIn 0.5s ease forwards;
}

.input-group:nth-child(2) {
    animation-delay: 0.1s;
}

.input-group:nth-child(3) {
    animation-delay: 0.2s;
}

.input-group:nth-child(4) {
    animation-delay: 0.3s;
}

.input-group:nth-child(5) {
    animation-delay: 0.4s;
}

.input-group:nth-child(6) {
    animation-delay: 0.5s;
}

@media (max-width: 768px) {
    .login-container {
        padding: 15px;
    }

    .login-box {
        padding: 30px;
        max-width: 90%;
    }
    
    .login-box h2 {
        font-size: 1.8rem;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .input-group {
        margin-bottom: 15px;
    }
    
    .input-group input {
        padding: 10px 12px;
        font-size: 15px;
    }
    
    button {
        padding: 12px;
    }
}

@media (max-width: 480px) {
    .login-container {
        padding: 15px;
    }
    
    .login-box {
        padding: 20px;
        border-radius: 12px;
    }
    
    .login-box h2 {
        font-size: 1.5rem;
        margin-bottom: 20px;
    }
    
    .input-group label {
        font-size: 0.9rem;
    }
    
    .input-group input {
        padding: 10px;
        font-size: 14px;
    }
    
    button {
        padding: 10px;
        font-size: 15px;
    }
    
    .login-link {
        font-size: 0.85rem;
    }
}

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

    .login-box h2 {
        font-size: 1.6rem;
        margin-bottom: 20px;
    }

    .input-group input {
        padding: 10px;
        font-size: 14px;
    }

    button {
        padding: 12px;
        font-size: 15px;
    }
}

/* Estilos para el campo de contraseña con ícono de ojo */
.password-container {
    position: relative;
    width: 100%;
}

/* Corrección para el botón de mostrar/ocultar contraseña */
.password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: rgba(255, 255, 255, 0.5);
    transition: color 0.3s ease;
    z-index: 10;
    background: none;
    border: none;
    padding: 0;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    pointer-events: auto; /* Asegura que el botón reciba eventos de clic */
}

.password-toggle:hover {
    color: var(--accent-color);
}

.password-toggle:focus {
    outline: none;
}

.input-group .password-container input {
    padding-right: 40px; /* Espacio para el ícono */
    width: 100%;
    box-sizing: border-box;
}

/* Asegurarse que el ícono esté visible */
.password-toggle i {
    display: block;
    line-height: 1;
}

/* Animación para el ícono de ojo */
@keyframes eyePulse {
    0% { transform: translateY(-50%) scale(1); }
    50% { transform: translateY(-50%) scale(1.1); }
    100% { transform: translateY(-50%) scale(1); }
}

.password-toggle:active {
    animation: eyePulse 0.3s ease;
}