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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    min-height: 100vh;
    min-height: 100dvh; /* Se adapta cuando la barra de direcciones se oculta/muestra */
    background: linear-gradient(135deg, #1b1e38 0%, #1f2347 50%, #161a32 100%);
    background-size: 400% 400%;
    animation: gradientShift 8s ease infinite;
}

/* Animación de fondo */
@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Efectos de nebulosa en el fondo */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 20% 80%, rgba(59, 130, 246, 0.4) 0%, transparent 50%),
                radial-gradient(circle at 80% 20%, rgba(147, 197, 253, 0.3) 0%, transparent 50%),
                radial-gradient(circle at 40% 40%, rgba(96, 165, 250, 0.2) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

.login-container {
    display: flex;
    min-height: 100vh;
    min-height: 100dvh; /* Se adapta dinámicamente al viewport móvil */
    position: relative;
    z-index: 1;
    gap: 0;
    padding: 2rem;
    align-items: center;
    justify-content: center;
}

/* Container principal unificado */
.unified-container {
    display: flex;
    background: rgba(255, 255, 255, 0.11);
    backdrop-filter: blur(15px);
    border-radius: 25px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25),
                0 0 30px rgba(120, 200, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    position: relative;
    overflow: hidden;
    transition: all 0.4s ease;
    width: 100%;
    max-width: 900px;
    height: 520px;
}

/* Efecto de brillo interno unificado */
.unified-container::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 200%;
    background: conic-gradient(transparent, rgba(255, 255, 255, 0.1), transparent 30%);
    animation: rotate 8s linear infinite;
    pointer-events: none;
    z-index: 1;
}

.unified-container::after {
    content: '';
    position: absolute;
    inset: 1px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 24px;
    pointer-events: none;
    z-index: 1;
}

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

.unified-container:hover {
    transform: translateY(-3px);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.3),
                0 0 40px rgba(120, 200, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.25);
}

/* Línea divisoria elegante */
.unified-container .divider {
    position: absolute;
    top: 10%;
    bottom: 10%;
    left: 50%;
    transform: translateX(-50%);
    width: 1px;
    background: linear-gradient(to bottom, 
        transparent 0%, 
        rgba(255, 255, 255, 0.2) 20%, 
        rgba(255, 255, 255, 0.4) 50%, 
        rgba(255, 255, 255, 0.2) 80%, 
        transparent 100%);
    z-index: 10;
}

/* Panel izquierdo */
.left-panel {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 2rem 3rem;
    position: relative;
    z-index: 2;
}

.logo-container {
    width: 100%;
    height: 100%;
    background: transparent;
    backdrop-filter: none;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
    border: none;
    position: relative;
    overflow: visible;
    transition: all 0.4s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Línea divisoria vertical */
.logo-container::after {
    display: none;
}

/* Efecto de brillo interno en el contenedor del logo */
.logo-container::before {
    display: none;
}

.perseo-logo {
    width: 45%;
    height: auto;
    max-width: 180px;
    filter: drop-shadow(0 0 30px rgba(59, 130, 246, 0.6));
    transition: all 0.4s ease;
    position: relative;
    z-index: 2;
    margin-bottom: 1.5rem;
}

.left-panel:hover .perseo-logo {
    filter: drop-shadow(0 0 40px rgba(59, 130, 246, 0.8));
    transform: scale(1.08);
}

.left-panel:hover .perseo-title {
    transform: translateY(-2px);
}

.left-panel:hover .perseo-title .perseo-text {
    text-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.left-panel:hover .perseo-subtitle {
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
}

/* Título PERSEO debajo del logo */
.perseo-title {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    color: #ffffff;
    font-weight: bold;
    font-size: 2.2rem;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    position: relative;
    z-index: 2;
    transition: all 0.4s ease;
}

.perseo-text {
    letter-spacing: 2px;
    font-family: 'Segoe UI', sans-serif;
}

.perseo-subtitle {
    font-size: 0.85rem;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.8);
    text-align: center;
    letter-spacing: 0.5px;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
    line-height: 1.4;
    margin-top: 1.2rem;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

/* Panel derecho */
.right-panel {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 2rem 3rem;
    position: relative;
    z-index: 2;
}

.login-form-container {
    background: transparent;
    backdrop-filter: none;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
    width: 100%;
    height: 100%;
    border: none;
    position: relative;
    overflow: visible;
    transition: all 0.4s ease;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Efectos hover para el logo del panel izquierdo */

/* Logo del header */
.header-logo {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2.5rem;
    margin-top: 0.5rem;
    position: relative;
    z-index: 3;
}

/* Título PERSEO para móviles (oculto por defecto) */
.mobile-perseo-title {
    display: none;
    text-align: center;
    color: #ffffff;
    font-weight: bold;
    font-size: 1.8rem;
    letter-spacing: 2px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    margin-bottom: 1.5rem;
    position: relative;
    z-index: 3;
}

/* Subtítulo para móviles (oculto por defecto) */
.mobile-perseo-subtitle {
    display: none;
    text-align: center;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.75rem;
    font-weight: 400;
    letter-spacing: 0.5px;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
    line-height: 1.3;
    margin-top: 1.5rem;
    position: relative;
    z-index: 3;
    flex-direction: column;
    gap: 0.2rem;
}

/* Logo móvil de Perseo (oculto por defecto) */
.mobile-perseo-logo {
    display: none;
    align-items: center;
    gap: 1.5rem;
}

.perseo-mobile-img {
    height: 90px;
    width: 90px;
    object-fit: contain;
    filter: drop-shadow(0 0 15px rgba(59, 130, 246, 0.6));
}

.separator {
    color: rgba(255, 255, 255, 0.8);
    font-size: 2.4rem;
    font-weight: 200;
    height: 90px;
    width: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    flex-shrink: 0;
}

.alcaldia-logo {
    height: 120px;
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

/* Mostrar solo el logo de desktop por defecto */
.mobile-alcaldia {
    display: none;
}

.desktop-alcaldia {
    display: block;
}

/* En desktop, el logo de alcaldía es grande porque está solo */
@media (min-width: 769px) {
    .alcaldia-logo {
        height: 120px;
        width: auto;
    }
}

/* Título */
.login-title {
    text-align: center;
    color: #ffffff;
    margin-bottom: 1.5rem;
    font-size: 1.05rem;
    font-weight: 400;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 3;
}

/* Grupos de input */
/* Grupos de input */
.input-group {
    margin-bottom: 1.2rem;
    position: relative;
    z-index: 3;
}

/* Estilos para el captcha */
.captcha-group {
    margin-bottom: 1.2rem;
}

.captcha-container {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    width: 100%;
}

.captcha-image {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    width: 100%;
}

/* Estilo para la imagen del captcha generada por Django */
.captcha-image img {
    height: 45px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
}

/* Estilo para el input del captcha generado por Django */
.captcha-image input[type="text"] {
    flex: 1;
    padding: 14px 18px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
    color: #ffffff;
    caret-color: #ffffff;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
    text-align: center;
    letter-spacing: 2px;
    font-weight: 600;
}

.captcha-image input[type="text"]::placeholder {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
    letter-spacing: normal;
    font-weight: normal;
}

.captcha-image input[type="text"]:focus {
    outline: none;
    border-color: rgba(59, 130, 246, 0.5);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15),
                inset 0 2px 4px rgba(0, 0, 0, 0.1);
    background: rgba(255, 255, 255, 0.12);
}

.input-group input {
    width: 100%;
    padding: 14px 18px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
    color: #ffffff;
    caret-color: #ffffff;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.input-group input::placeholder {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.input-group input:focus {
    outline: none;
    border-color: rgba(59, 130, 246, 0.5);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15),
                inset 0 2px 4px rgba(0, 0, 0, 0.1);
    background: rgba(255, 255, 255, 0.12);
}

.input-group input:focus::placeholder {
    color: rgba(255, 255, 255, 0.5);
    transform: translateX(4px);
}

/* Estilos para autocompletado del navegador */
.input-group input:-webkit-autofill,
.input-group input:-webkit-autofill:hover,
.input-group input:-webkit-autofill:focus,
.input-group input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 30px transparent inset !important;
    -webkit-text-fill-color: #ffffff !important;
    background-color: rgba(255, 255, 255, 0.08) !important;
    background-image: none !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    caret-color: #ffffff !important;
    transition: background-color 5000s ease-in-out 0s !important;
}

.input-group input:-webkit-autofill::first-line {
    color: #ffffff !important;
    font-family: inherit !important;
    font-size: 1rem !important;
}

/* Contenedor de contraseña con botón de mostrar */
.password-container {
    position: relative;
}

.password-container input {
    padding-right: 50px;
}

/* Estilos para autocompletado del campo de contraseña */
.password-container input:-webkit-autofill,
.password-container input:-webkit-autofill:hover,
.password-container input:-webkit-autofill:focus,
.password-container input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 30px transparent inset !important;
    -webkit-text-fill-color: #ffffff !important;
    background-color: rgba(255, 255, 255, 0.08) !important;
    background-image: none !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    caret-color: #ffffff !important;
    transition: background-color 5000s ease-in-out 0s !important;
}

.toggle-password {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.8);
    padding: 4px 6px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.toggle-password:hover {
    background: rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 1);
    border-color: rgba(59, 130, 246, 0.4);
}

/* Ocultar el ojo del navegador para mostrar contraseña */
.password-container input::-ms-reveal,
.password-container input::-ms-clear {
    display: none;
}

.password-container input::-webkit-credentials-auto-fill-button {
    display: none !important;
}

.password-container input::-webkit-strong-password-auto-fill-button {
    display: none !important;
}

/* Botón de login */
.login-btn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #4a90e2 0%, #2c5aa0 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 1rem;
    position: relative;
    z-index: 3;
}

.login-btn:hover {
    background: linear-gradient(135deg, #357abd 0%, #1e3c72 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(44, 90, 160, 0.3);
}

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

/* Enlace de contraseña olvidada */
.forgot-password {
    display: block;
    text-align: center;
    color: #ffffff;
    text-decoration: none;
    font-size: 0.9rem;
    margin-bottom: 2rem;
    transition: all 0.3s ease;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 3;
}

.forgot-password:hover {
    color: #87ceeb;
    text-decoration: underline;
    text-shadow: 0 0 8px rgba(135, 206, 235, 0.6);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .unified-container {
        max-width: 800px;
        height: 500px;
    }
    
    .left-panel,
    .right-panel {
        padding: 1.8rem 2.5rem;
    }
    
    /* En pantallas medianas, reducir un poco el logo de Alcaldía */
    .alcaldia-logo {
        height: 110px;
        width: auto;
    }
}

@media (max-width: 900px) {
    .unified-container {
        max-width: 650px;
        height: 480px;
    }
}

@media (max-width: 768px) {
    body {
        height: 100vh;
        height: 100dvh; /* Altura dinámica para móviles */
        overflow-x: hidden;
    }
    
    .login-container {
        min-height: 100vh;
        min-height: 100dvh; /* Se adapta cuando la barra se oculta */
        padding: 1rem;
        align-items: center;
        justify-content: center;
    }
    
    .unified-container {
        flex-direction: column;
        max-width: 500px;
        width: 100%;
        height: auto;
        min-height: 520px;
        transition: all 0.4s ease;
        justify-content: center;
        align-items: center;
    }
    
    .divider {
        display: none;
    }
    
    /* Ocultar el panel izquierdo en pantallas pequeñas */
    .left-panel {
        display: none;
    }
    
    .right-panel {
        padding: 3rem 2rem;
        transition: all 0.4s ease;
        min-height: 520px;
        width: 100%;
        max-width: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .login-form-container {
        width: 100%;
        max-width: 100%;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        padding: 2rem 1rem;
        min-height: 520px;
    }
    
    /* Mostrar el logo móvil de Perseo */
    .mobile-perseo-logo {
        display: flex;
    }
    
    /* Mostrar título y subtítulo PERSEO en tablets */
    .mobile-perseo-title {
        display: block;
        margin-bottom: 0.8rem;
        font-size: 1.6rem;
    }

    .mobile-perseo-subtitle {
        display: flex;
        margin-top: 0.8rem;
        font-size: 0.75rem;
    }

    .header-logo {
        margin-bottom: 1.2rem;
        margin-top: 1rem;
        gap: 1rem;
        width: 100%;
        justify-content: center;
    }
    
    /* En tablets, mantener el mismo tamaño que desktop (120px) */
    .alcaldia-logo {
        height: 120px;
        width: auto;
        max-width: 140px;
        object-fit: contain;
    }
    
    .perseo-mobile-img {
        height: 120px;
        width: auto;
        max-width: 140px;
        object-fit: contain;
    }
    
    .separator {
        font-size: 2.2rem;
        height: 120px;
        width: 35px;
    }
    
    /* Ajustar formulario para mejor proporción */
    form {
        width: 100%;
        max-width: 400px;
        margin: 0 auto;
    }
    
    .input-group {
        width: 100%;
    }
    
    .login-btn {
        width: 100%;
    }
    
    .forgot-password {
        text-align: center;
        width: 100%;
    }
}


@media (max-width: 600px) {
    .unified-container {
        max-width: 95vw;
        height: auto;
        min-height: 500px;
    }
    
    .right-panel {
        padding: 3rem 1.5rem;
        min-height: 500px;
    }
    
    .login-form-container {
        padding: 2rem 0.8rem;
        min-height: 500px;
    }
}

@media (max-width: 480px) {
    .login-container {
        padding: 0.5rem;
        align-items: center;
        justify-content: center;
    }
    
    .unified-container {
        min-height: 500px;
        height: auto;
        width: 100%;
        max-width: 95vw;
        justify-content: center;
        align-items: center;
    }
    
    .right-panel {
        max-width: none;
        width: 100%;
        padding: 2.8rem 1rem;
        transition: all 0.4s ease;
        min-height: 500px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .login-form-container {
        padding: 2rem 0.5rem;
        border-radius: 20px;
        min-height: 500px;
        width: 100%;
        max-width: 100%;
        transition: all 0.4s ease;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
    }
    
    .header-logo {
        margin-bottom: 1rem;
        margin-top: 0.8rem;
        gap: 0;
        flex-direction: row;
        align-items: center;
        justify-content: center;
        width: 100%;
        max-width: 85vw;
        margin-left: auto;
        margin-right: auto;
    }
    
    /* Mostrar ambos logos en disposición horizontal */
    .mobile-perseo-logo {
        display: flex !important;
        flex-direction: row;
        align-items: center;
        justify-content: center;
        gap: 0;
        width: 100%;
    }
    
    /* Logo de Perseo en pantallas pequeñas */
    .perseo-mobile-img {
        height: 120px;
        width: auto;
        max-width: 140px;
        object-fit: contain;
        object-position: center;
        filter: drop-shadow(0 0 15px rgba(59, 130, 246, 0.6));
        flex-shrink: 0;
    }
    
    /* Separador visible en pantallas pequeñas */
    .separator {
        color: rgba(255, 255, 255, 0.8);
        font-size: 2.2rem;
        font-weight: 200;
        height: 120px;
        width: 35px;
        display: flex;
        align-items: center;
        justify-content: center;
        line-height: 1;
        flex-shrink: 0;
    }
    
    /* Logo de Alcaldía en misma fila */
    .alcaldia-logo {
        height: 120px;
        width: auto;
        max-width: 140px;
        object-fit: contain;
        object-position: center;
        flex-shrink: 0;
    }
    
    /* En móvil mostrar el logo dentro del contenedor y ocultar el de desktop */
    .mobile-alcaldia {
        display: block;
    }
    
    .desktop-alcaldia {
        display: none;
    }
    
    .mobile-perseo-title {
        font-size: 1.4rem;
        margin-bottom: 1rem;
        text-align: center;
        width: 100%;
        display: block;
    }
    
    .mobile-perseo-subtitle {
        font-size: 0.7rem;
        margin-top: 1rem;
        text-align: center;
        width: 100%;
        display: flex;
    }
    
    .login-title {
        font-size: 1rem;
        margin-bottom: 1.2rem;
        text-align: center;
        width: 100%;
    }
    
    /* Formulario centrado y bien proporcionado */
    form {
        width: 100%;
        max-width: 320px;
        margin: 0 auto;
    }
    
    .input-group {
        margin-bottom: 1rem;
        width: 100%;
    }
    
    /* Captcha con espaciado optimizado */
    .captcha-container {
        gap: 0.8rem;
        flex-wrap: nowrap;
        margin-bottom: 1.2rem;
        width: 100%;
    }
    
    .captcha-image {
        gap: 0.8rem;
        flex-wrap: nowrap;
        width: 100%;
    }
    
    .captcha-image img {
        height: 40px;
        max-width: 140px;
        width: auto;
        flex-shrink: 0;
    }
    
    .captcha-image input[type="text"] {
        padding: 12px 16px;
        font-size: 0.9rem;
        min-width: 140px;
        flex: 1;
    }
    
    .login-btn {
        width: 100%;
    }
    
    .forgot-password {
        margin-bottom: 1.5rem;
        font-size: 0.9rem;
        text-align: center;
        width: 100%;
    }
}