/* ========================================
   RESET Y FONDO
======================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg,
        #372459 0%,
        #362B8D 25%,
        #621AFF 50%,
        #805DD6 75%,
        #B9A5E3 100%
    );
    background-size: 400% 400%;
    position: relative;
    overflow-x: hidden;
    overflow-y: auto;
    animation: gradientShift 15s ease infinite;
    padding: 20px 0;
}

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

body::before {
    content: '';
    position: fixed;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: 0;
    background-image:
        radial-gradient(ellipse at 20% 30%, rgba(222, 215, 255, 0.5) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 70%, rgba(185, 165, 227, 0.35) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(98, 26, 255, 0.25) 0%, transparent 50%);
    animation: wave1 12s ease-in-out infinite;
    mix-blend-mode: soft-light;
    pointer-events: none;
}

body::after {
    content: '';
    position: fixed;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: 0;
    background-image:
        radial-gradient(ellipse at 60% 20%, rgba(222, 215, 255, 0.4) 0%, transparent 50%),
        radial-gradient(ellipse at 30% 80%, rgba(54, 43, 141, 0.35) 0%, transparent 50%);
    animation: wave2 18s ease-in-out infinite;
    mix-blend-mode: soft-light;
    pointer-events: none;
}

@keyframes wave1 {
    0%, 100% { transform: translate(0, 0) scale(1); opacity: 1; }
    33% { transform: translate(5%, -5%) scale(1.1); opacity: 0.8; }
    66% { transform: translate(-3%, 5%) scale(0.95); opacity: 0.9; }
}

@keyframes wave2 {
    0%, 100% { transform: translate(0, 0) scale(1) rotate(0deg); opacity: 0.9; }
    50% { transform: translate(-5%, 3%) scale(1.05) rotate(5deg); opacity: 0.7; }
}

/* ========================================
   WRAPPER Y CONTAINER
======================================== */

.login-wrapper {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 1000px;
    padding: 20px;
}

.login-container {
    display: grid;
    grid-template-columns: 1.2fr 1.2fr;
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    overflow: hidden;
    box-shadow:
        0 20px 60px rgba(55, 36, 89, 0.35),
        0 0 0 1px rgba(255, 255, 255, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.6);
    min-height: 550px;
    animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ========================================
   PANEL IZQUIERDO - LOGO
======================================== */

.login-left {
    background: linear-gradient(135deg, #372459 0%, #362B8D 50%, #621AFF 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 3rem;
    position: relative;
    overflow: hidden;
}

.login-left::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background:
        radial-gradient(circle at 30% 40%, rgba(222, 215, 255, 0.18) 0%, transparent 50%),
        radial-gradient(circle at 70% 60%, rgba(185, 165, 227, 0.15) 0%, transparent 50%);
    animation: rotate 20s linear infinite;
}

.login-left::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.15) 50%,
        transparent 100%);
    animation: shine 4s ease-in-out infinite;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes shine {
    0% { left: -100%; }
    50%, 100% { left: 200%; }
}

.logo-section {
    position: relative;
    z-index: 2;
    text-align: center;
}

/* Anillo LGBT, mismo patrón que el sidebar */
.login-logo-wrapper {
    display: inline-block;
    padding: 12px;
    border-radius: 50%;
    background: linear-gradient(
        to bottom,
        #E40303 0%,
        #FF8C00 16.66%,
        #FFED00 33.33%,
        #008026 50%,
        #24408E 66.66%,
        #732982 83.33%
    );
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
    animation: logoFloat 3s ease-in-out infinite;
}

.login-logo-wrapper img {
    display: block;
    width: 260px;
    height: 260px;
    object-fit: cover;
    border-radius: 50%;
    background: #372459;
    padding: 10px;
}

@keyframes logoFloat {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-8px); }
}

.logo-section h2 {
    color: white;
    font-size: 1.5rem;
    font-weight: 700;
    margin-top: 1.5rem;
    text-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.logo-section p {
    color: rgba(255,255,255,0.9);
    font-size: 0.95rem;
    margin-top: 0.5rem;
    letter-spacing: 0.05em;
}

/* ========================================
   PANEL DERECHO - FORMULARIO
======================================== */

.login-right {
    padding: 3rem 2.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.login-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: #372459;
    margin-bottom: 0.5rem;
    text-align: center;
}

.login-subtitle {
    color: #6B5FA8;
    font-size: 0.95rem;
    margin-bottom: 2rem;
    text-align: center;
}

/* ========================================
   FORMULARIO Y CAMPOS
======================================== */

.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    font-weight: 600;
    color: #372459;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #DED7FF;
    border-radius: 10px;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    background: white;
}

.form-control:focus {
    outline: none;
    border-color: #805DD6;
    box-shadow: 0 0 0 3px rgba(128, 93, 214, 0.15);
    background: #FBFAFF;
}

.password-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-wrapper .form-control {
    padding-right: 3rem;
    flex: 1;
}

.password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #805DD6;
    cursor: pointer;
    padding: 0.5rem;
    font-size: 1.2rem;
    transition: color 0.2s ease;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
}

.password-toggle:hover {
    color: #621AFF;
}

.password-toggle:focus {
    outline: 2px solid #805DD6;
    outline-offset: 2px;
    border-radius: 4px;
}

/* ========================================
   BOTÓN DE LOGIN
======================================== */

.btn-login {
    width: 100%;
    padding: 0.875rem;
    background: linear-gradient(135deg, #362B8D 0%, #621AFF 50%, #805DD6 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    box-shadow: 0 4px 15px rgba(98, 26, 255, 0.35);
    position: relative;
    overflow: hidden;
}

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

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

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(98, 26, 255, 0.4);
}

.btn-login:active {
    transform: translateY(0);
}

/* ========================================
   LINK DE RECUPERACIÓN
======================================== */

.forgot-link {
    text-align: center;
    margin-top: 1.25rem;
}

.forgot-link a {
    color: #805DD6;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

.forgot-link a:hover {
    color: #621AFF;
    text-decoration: underline;
}

/* ========================================
   ALERTAS
======================================== */

.alert {
    padding: 0.875rem 1rem;
    border-radius: 10px;
    margin-bottom: 1.5rem;
    border: none;
    animation: slideDown 0.4s ease-out;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.alert-danger {
    background: #FEE2E2;
    color: #991B1B;
}

/* ========================================
   RESPONSIVE
======================================== */

@media (max-width: 768px) {
    body {
        align-items: flex-start;
        min-height: 100%;
    }

    .login-wrapper {
        padding: 15px;
    }

    .login-container {
        grid-template-columns: 1fr;
        max-width: 450px;
        min-height: auto;
    }

    .login-left {
        padding: 2rem 1.5rem;
        min-height: auto;
    }

    .login-logo-wrapper img {
        width: 120px;
        height: 120px;
    }

    .logo-section h2 {
        font-size: 1.25rem;
    }

    .login-right {
        padding: 2rem 1.75rem;
    }
}

@media (max-width: 400px) {
    .login-left {
        padding: 1.5rem 1.25rem;
    }

    .login-right {
        padding: 1.5rem 1.25rem;
    }

    .form-control {
        padding: 0.65rem 0.875rem;
        font-size: 0.9rem;
    }

    .password-toggle {
        right: 8px;
        font-size: 1.1rem;
    }
}