/* ===== BLOQUEAR ELEMENTOS SOMEE ===== */
body > center,
center:has(a[href*="somee.com"]),
a[href*="somee.com"] {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    height: 0 !important;
    width: 0 !important;
    overflow: hidden !important;
    position: absolute !important;
    left: -9999px !important;
}

body > div:not(.container):not(.modal):not(.tooltip):not(.alert):not(.position-relative),
body > iframe:not([src*="perenergy"]),
body > script[src*="somee"],
body > div[id*="somee"],
body > div[class*="somee"],
body > div[style*="position:fixed"]:not(.alert),
body > div[style*="bottom:0"]:not(.alert),
body > div[style*="top:0"]:not(.navbar) {
    display: none !important;
}

/* ===== MEJORAS ADICIONALES PARA PANTALLAS GRANDES ===== */
@media (min-width: 1200px) {
    .col-md-5 {
        max-width: 480px !important;
    }

    .card.login-card {
        max-width: 480px !important;
    }

    img[src*="logo.png"] {
        height: 160px !important;
    }
}

/* ===== CORREGIR EL CONTENEDOR PRINCIPAL ===== */
.container {
    position: relative;
    z-index: 9999 !important;
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
    display: flex;
    flex-direction: column;
}

/* ===== GARANTIZAR QUE EL BODY OCUPE TODA LA ALTURA ===== */
html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
}

.login-body {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh !important;
    width: 100% !important;
}

/* ===== MANTENER LOS ESTILOS EXISTENTES PARA MÓVIL ===== */
/* Tus estilos móviles actuales se mantienen igual... */

/* ===== OPTIMIZAR PARA PANTALLAS MEDIANAS (TABLETS) ===== */
@media (min-width: 769px) and (max-width: 1024px) {
    .col-md-5 {
        max-width: 420px !important;
    }

    .card.login-card {
        max-width: 420px !important;
    }

    .card-body.p-4.p-md-5 {
        padding: 2.5rem 2rem !important;
    }
}
/* ===== PANTALLA COMPLETA EN MÓVILES ===== */
html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.login-body {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh !important;
    height: 100vh !important; /* Pantalla completa */
    display: flex;
    align-items: stretch;
    padding: 0 !important;
    margin: 0 !important;
    overflow: hidden;
    position: relative;
}

.container {
    position: relative;
    z-index: 9999 !important;
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

/* PANTALLA COMPLETA PARA MÓVILES */
@media (max-width: 768px) {
    .login-body {
        height: 100vh !important;
        min-height: 100vh !important;
        display: flex;
        align-items: stretch;
        overflow: hidden;
    }

    .container {
        height: 100%;
        display: flex;
        flex-direction: column;
        padding: 0 !important;
        margin: 0 !important;
    }

    .row.justify-content-center.align-items-center {
        min-height: 100vh !important;
        height: 100vh;
        margin: 0 !important;
        padding: 0 !important;
        width: 100%;
        flex: 1;
        display: flex;
        align-items: center;
    }

    .col-md-5 {
        flex: 1;
        max-width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
        display: flex;
        flex-direction: column;
        justify-content: center;
        height: 100%;
    }

    .card.login-card {
        margin: 0 !important;
        width: 100% !important;
        height: 100% !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        display: flex;
        flex-direction: column;
        justify-content: center;
        max-width: none !important;
    }

    .card-body.p-5 {
        padding: 2rem 1.5rem !important;
        flex: 1;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }
}

/* ===== OPTIMIZACIONES ESPECÍFICAS PARA VIVO V40 LITE ===== */
/* Ajustes específicos para pantallas altas y estrechas */
@media (max-width: 430px) and (min-height: 900px) {
    .login-body {
        height: 100vh !important;
    }

    .min-vh-100 {
        min-height: 100vh !important;
    }

    .row.justify-content-center {
        margin: 0;
        width: 100%;
    }

    .col-md-5 {
        flex: 0 0 100% !important;
        max-width: 100% !important;
    }
}

/* Ajustes ultra específicos para Vivo V40 Lite (360x740) */
@media (width: 360px) and (height: 740px) {
    .login-body {
        height: 100vh !important;
    }

    .card.login-card {
        margin: 0 auto;
        width: 100% !important;
        height: 100% !important;
    }

    .card-body.p-5 {
        padding: 2rem 1.5rem !important;
    }
}

/* Optimizaciones para pantallas muy altas */
@media (min-height: 900px) {
    .min-vh-100 {
        min-height: 100vh;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

/* ===== ESTILOS EXISTENTES MANTENIDOS CON MEJORAS ===== */
.alert-danger {
    border-left: 4px solid #dc3545;
    background-color: #f8d7da;
    border-color: #f5c6cb;
}

.alert i {
    font-size: 1.1em;
}

.input-group-text {
    background-color: #f8f9fa;
    border-radius: 8px 0 0 8px;
    min-width: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Mejorar responsividad de inputs */
.form-group.mb-3,
.form-group.mb-4 {
    margin-bottom: 1.2rem !important;
}

/* Mejoras de rendimiento para móviles */
.login-card {
    border: none;
    border-radius: 12px;
    backdrop-filter: blur(8px);
    background: rgba(255, 255, 255, 0.98);
    margin: 0 auto;
    width: 95%;
    max-width: 400px;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
}

/* En escritorio mantiene bordes redondeados, en móviles pantalla completa */
@media (min-width: 769px) {
    .login-card {
        border-radius: 12px;
        height: auto !important;
        margin: 0 auto;
        width: 95%;
        max-width: 400px;
    }

    .login-body {
        height: 100vh;
        align-items: center;
        padding: 20px 0;
    }
}

.card-body.p-5 {
    padding: 2.5rem 2rem !important;
}

/* Optimizar textos para móviles */
@media (max-width: 768px) {
    .login-title {
        font-size: 1.4rem !important;
        line-height: 1.3 !important;
        margin-bottom: 0.5rem !important;
    }

    .text-center.mb-4 {
        margin-bottom: 1.5rem !important;
    }

    .text-muted {
        font-size: 0.9rem;
    }

    img[src*="logo.png"] {
        height: 100px !important;
        margin-bottom: 8px !important;
    }
}

/* Mejorar inputs para touch */
.form-control {
    border-radius: 8px;
    padding: 14px 16px !important;
    border: 1px solid #ddd;
    transition: all 0.3s;
    font-size: 16px;
    -webkit-appearance: none;
}

    .form-control:focus {
        border-color: #667eea;
        box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
    }

/* Botones más táctiles */
.btn-login {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s;
    padding: 14px 20px !important;
    font-size: 16px;
    min-height: 50px;
}

    .btn-login:hover {
        transform: translateY(-1px);
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    }

/* Optimizar alertas para móviles */
.alert {
    padding: 12px 16px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

/* Ajustes específicos para Safari iOS */
@supports (-webkit-touch-callout: none) {
    .login-body {
        height: -webkit-fill-available;
    }

    .min-vh-100 {
        min-height: -webkit-fill-available;
    }
}

/* Prevenir problemas de visualización en diferentes navegadores móviles */
* {
    -webkit-tap-highlight-color: transparent;
    box-sizing: border-box;
}

/* Asegurar que el contenido sea siempre visible */
.row.justify-content-center.align-items-center {
    min-height: 100vh;
    margin: 0;
    width: 100%;
}

/* Optimizar el footer */
.text-center.mt-3 {
    margin-top: 1.5rem !important;
}

    .text-center.mt-3 small {
        font-size: 0.8rem;
    }

/* Asegurar que todo se vea bien en modo retrato y paisaje */
@media (orientation: landscape) and (max-height: 500px) {
    .login-body {
        height: auto;
        min-height: 100vh;
    }

    .min-vh-100 {
        min-height: 100vh;
        padding: 20px 0;
    }

    .card.login-card {
        margin: 20px auto;
        height: auto !important;
    }

    .card-body.p-5 {
        padding: 1.5rem !important;
    }
}

/* Para pantallas muy pequeñas (menos de 360px) */
@media (max-width: 359px) {
    .card-body.p-5 {
        padding: 1rem 1rem !important;
    }

    .btn-login {
        padding: 12px !important;
        min-height: 45px;
    }

    .form-control {
        padding: 12px !important;
    }

    img[src*="logo.png"] {
        height: 80px !important;
    }
}
