/* ========================================
   ESTILOS DEL LOGIN - INDEX.CSS
   ======================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #0f0c1f 0%, #1a1a2e 50%, #16213e 100%);
    padding: 20px;
    animation: gradientBG 15s ease infinite;
    position: relative;
    overflow: hidden;
}

/* Efecto de partículas/estrellas */
body::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(2px 2px at 20px 30px, #fff, rgba(0,0,0,0)),
        radial-gradient(2px 2px at 40px 70px, #fff, rgba(0,0,0,0)),
        radial-gradient(2px 2px at 80px 190px, #fff, rgba(0,0,0,0)),
        radial-gradient(2px 2px at 160px 270px, #fff, rgba(0,0,0,0)),
        radial-gradient(2px 2px at 250px 150px, #fff, rgba(0,0,0,0)),
        radial-gradient(2px 2px at 350px 450px, #fff, rgba(0,0,0,0)),
        radial-gradient(2px 2px at 450px 250px, #fff, rgba(0,0,0,0)),
        radial-gradient(2px 2px at 550px 350px, #fff, rgba(0,0,0,0));
    background-repeat: repeat;
    opacity: 0.3;
    pointer-events: none;
}

@keyframes gradientBG {
    0% { background-position: 0% 0%; }
    50% { background-position: 100% 100%; }
    100% { background-position: 0% 0%; }
}

.login-card {
    background: rgba(18, 18, 30, 0.95);
    backdrop-filter: blur(20px);
    padding: 2.8rem;
    border-radius: 30px;
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.8),
        0 0 0 1px rgba(255, 255, 255, 0.05) inset,
        0 0 20px rgba(79, 114, 202, 0.2);
    width: 100%;
    max-width: 420px;
    transform: translateY(0);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid rgba(255, 255, 255, 0.08);
    position: relative;
    z-index: 10;
}

.login-card:hover {
    transform: translateY(-8px);
    box-shadow: 
        0 30px 80px rgba(0, 0, 0, 0.9),
        0 0 0 1px rgba(79, 114, 202, 0.3) inset,
        0 0 30px rgba(79, 114, 202, 0.3);
}

.login-card::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #4f72ca, #9d65c9, #4f72ca);
    border-radius: 32px;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.login-card:hover::before {
    opacity: 0.3;
}

.login-card h2 {
    text-align: center;
    color: #fff;
    margin-bottom: 2.5rem;
    font-size: 2.3rem;
    font-weight: 700;
    position: relative;
    padding-bottom: 15px;
    text-shadow: 0 2px 10px rgba(79, 114, 202, 0.3);
    letter-spacing: 1px;
}

.login-card h2 i {
    color: #4f72ca;
    margin-right: 10px;
    filter: drop-shadow(0 2px 5px rgba(79, 114, 202, 0.5));
}

.login-card h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, #4f72ca, #9d65c9, #4f72ca);
    border-radius: 4px;
    animation: widthGrow 0.8s ease-out;
    box-shadow: 0 0 10px #4f72ca;
}

@keyframes widthGrow {
    from { width: 0; opacity: 0; }
    to { width: 60px; opacity: 1; }
}

.input-group {
    position: relative;
    margin-bottom: 25px;
}

.input-group i {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: #6b7280;
    transition: all 0.3s ease;
    font-size: 1.2rem;
    z-index: 10;
}

.input-group.focused i {
    color: #4f72ca;
    text-shadow: 0 0 10px #4f72ca;
}

.input-group input {
    width: 100%;
    padding: 18px 18px 18px 50px;
    border: 2px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: rgba(10, 10, 20, 0.6);
    color: #fff;
    outline: none;
    letter-spacing: 0.5px;
}

.input-group input::placeholder {
    color: rgba(255, 255, 255, 0.3);
    font-weight: 300;
}

.input-group input:focus {
    border-color: #4f72ca;
    background: rgba(20, 20, 35, 0.8);
    box-shadow: 
        0 0 0 4px rgba(79, 114, 202, 0.15),
        0 0 20px rgba(79, 114, 202, 0.2);
}

.input-group input.valid {
    border-color: #10b981;
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.1);
}

.input-group input.invalid {
    border-color: #ef4444;
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.1);
}

/* Estilo mejorado para el ojito */
.password-toggle {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: #9ca3af;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 20;
    background: rgba(30, 30, 45, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    backdrop-filter: blur(5px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.password-toggle:hover {
    color: #4f72ca;
    background: rgba(50, 50, 70, 0.95);
    border-color: #4f72ca;
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 0 20px #4f72ca;
}

.password-toggle:active {
    transform: translateY(-50%) scale(0.95);
}

.password-toggle i {
    position: static;
    transform: none;
    color: inherit;
    font-size: 1.1rem;
    transition: all 0.3s ease;
}

.password-toggle:hover i {
    color: #4f72ca;
    text-shadow: 0 0 10px #4f72ca;
}

.input-validation {
    position: absolute;
    right: 60px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.1rem;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 15;
}

.input-group.focused .input-validation {
    opacity: 1;
}

.fa-check-circle {
    color: #10b981;
    filter: drop-shadow(0 0 5px #10b981);
}

.fa-exclamation-circle {
    color: #ef4444;
    filter: drop-shadow(0 0 5px #ef4444);
}

button[type="submit"] {
    width: 100%;
    padding: 18px;
    background: linear-gradient(135deg, #4f72ca 0%, #7b5fc0 50%, #9d65c9 100%);
    color: white;
    border: none;
    border-radius: 16px;
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
    margin-top: 20px;
    letter-spacing: 1px;
    text-transform: uppercase;
    box-shadow: 0 5px 20px rgba(79, 114, 202, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

button[type="submit"]::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

button[type="submit"]:hover::before {
    width: 400px;
    height: 400px;
}

button[type="submit"]:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 10px 30px rgba(79, 114, 202, 0.6);
    background: linear-gradient(135deg, #5d7ed6 0%, #8b6fd0 50%, #ad75d9 100%);
}

button[type="submit"]:active {
    transform: translateY(-2px) scale(0.98);
}

button[type="submit"]:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

#mensaje {
    margin-top: 25px;
    padding: 14px;
    border-radius: 12px;
    font-size: 14px;
    text-align: center;
    font-weight: 500;
    animation: messagePop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

@keyframes messagePop {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(-10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

#mensaje.success {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
    text-shadow: 0 0 10px rgba(16, 185, 129, 0.3);
}

#mensaje.error {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
    text-shadow: 0 0 10px rgba(239, 68, 68, 0.3);
}

/* Loading animation mejorada */
.fa-spinner {
    animation: spin 1s linear infinite;
    filter: drop-shadow(0 0 5px #fff);
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Shake animation mejorada */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-8px); }
    20%, 40%, 60%, 80% { transform: translateX(8px); }
}

.shake {
    animation: shake 0.6s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

/* Efecto de brillo en los inputs */
.input-group::after {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #4f72ca, #9d65c9, #4f72ca);
    border-radius: 18px;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.input-group.focused::after {
    opacity: 0.3;
}

/* Versión móvil */
@media (max-width: 480px) {
    .login-card {
        padding: 2rem;
    }

    .login-card h2 {
        font-size: 1.8rem;
    }

    .password-toggle {
        width: 34px;
        height: 34px;
        right: 12px;
    }

    .input-validation {
        right: 55px;
    }
}