/* 
 * IMCo Login - Public Styles 
 * Responsivo para PC, Tablet y Celular
 */

/* Variables de color basadas en la imagen */
:root {
    --imco-bg: #ffffff;
    --imco-text: #333333;
    --imco-border: #e2e8f0;
    --imco-icon-bg: #f1f5f9;
    --imco-btn-bg: #000000;
    --imco-btn-text: #ffffff;
    --imco-btn-hover: #333333;
    --imco-error: #ef4444;
    --imco-success: #22c55e;
}

/* Botón disparador */
.imco-trigger-btn {
    background-color: var(--imco-btn-bg);
    color: var(--imco-btn-text);
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.3s ease;
}

.imco-trigger-btn:hover {
    background-color: var(--imco-btn-hover);
}

/* Overlay del Modal */
.imco-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.75);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

/* Contenedor Principal (El diseño dividido) */
.imco-modal-container {
    background-color: var(--imco-bg);
    width: 90%;
    max-width: 900px;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    animation: imcoFadeInUp 0.4s ease forwards;
}

@keyframes imcoFadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Botón Cerrar */
.imco-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: #fff;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    z-index: 10;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333;
}

/* Estructura Flexbox para PC/Tablet */
.imco-modal-content {
    display: flex;
    flex-direction: row;
    min-height: 500px;
}

/* Lado Izquierdo: Imagen */
.imco-modal-image {
    flex: 1;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: block;
}

/* Lado Derecho: Formularios */
.imco-modal-forms {
    flex: 1;
    padding: 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Pestañas */
.imco-tabs {
    display: flex;
    margin-bottom: 30px;
    border-bottom: 2px solid var(--imco-border);
}

.imco-tab-btn {
    background: none;
    border: none;
    padding: 10px 20px;
    font-size: 16px;
    font-weight: 600;
    color: #94a3b8;
    cursor: pointer;
    position: relative;
    bottom: -2px;
}

.imco-tab-btn.active {
    color: var(--imco-text);
    border-bottom: 2px solid var(--imco-btn-bg);
}

/* Inputs */
.imco-input-group {
    display: flex;
    align-items: center;
    border: 1px solid var(--imco-border);
    border-radius: 6px;
    margin-bottom: 15px;
    overflow: hidden;
    background: #fff;
}

.imco-input-icon {
    background-color: var(--imco-icon-bg);
    color: #64748b;
    padding: 12px 15px;
    border-right: 1px solid var(--imco-border);
    display: flex;
    align-items: center;
    justify-content: center;
}

.imco-input-group input,
.imco-input-group select {
    flex: 1;
    border: none !important;
    padding: 12px 15px !important;
    outline: none !important;
    box-shadow: none !important;
    background: transparent !important;
    width: 100%;
}

.imco-toggle-password {
    padding: 0 15px;
    color: #64748b;
    cursor: pointer;
}

/* Fila de 2 columnas (Nombre / Apellido) */
.imco-input-row {
    display: flex;
    gap: 15px;
}

.imco-input-row .imco-input-group {
    flex: 1;
}

/* Acciones extra */
.imco-form-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    margin-bottom: 20px;
}

.imco-terms {
    font-size: 13px;
    margin-bottom: 20px;
    line-height: 1.4;
}

/* Botón Submit */
.imco-submit-btn {
    width: 100%;
    background-color: var(--imco-btn-bg);
    color: var(--imco-btn-text);
    padding: 14px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

.imco-submit-btn:hover {
    background-color: var(--imco-btn-hover);
}

/* Mensajes */
.imco-form-message {
    margin-top: 15px;
    font-size: 14px;
    text-align: center;
}

.imco-form-message.error {
    color: var(--imco-error);
}

.imco-form-message.success {
    color: var(--imco-success);
}

/* RESPONSIVE: Celulares y Tablets pequeñas */
@media (max-width: 768px) {
    .imco-modal-content {
        flex-direction: column;
    }

    .imco-modal-image {
        height: 200px;
        /* Mostrar un poco de la imagen arriba */
        flex: none;
    }

    .imco-modal-forms {
        padding: 25px;
    }

    .imco-input-row {
        flex-direction: column;
        gap: 0;
    }
}

/* ============================================================
   CORRECCIÓN DE ICONOS FONT AWESOME (Evitar conflictos con el tema)
   ============================================================ */
.imco-modal-container .fa-solid,
.imco-modal-container .fa-regular,
.imco-modal-container .fas,
.imco-modal-container .far {
    font-family: "Font Awesome 6 Free" !important;
    font-style: normal !important;
    font-variant: normal !important;
    text-rendering: auto !important;
    line-height: 1 !important;
    -moz-osx-font-smoothing: grayscale !important;
    -webkit-font-smoothing: antialiased !important;
    display: inline-block !important;
}

/* Los iconos Solid REQUIEREN font-weight 900 */
.imco-modal-container .fa-solid,
.imco-modal-container .fas {
    font-weight: 900 !important;
}

/* Los iconos Regular REQUIEREN font-weight 400 */
.imco-modal-container .fa-regular,
.imco-modal-container .far {
    font-weight: 400 !important;
}

/* Asegurar que el icono se centre bien en su contenedor */
.imco-input-icon,
.imco-toggle-password {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    /* Ancho fijo para el contenedor del icono */
    height: 100%;
}

.imco-input-icon i,
.imco-toggle-password i {
    font-size: 16px !important;
    /* Forzar tamaño */
    color: #64748b !important;
    /* Forzar color */
}

/* --- LAYOUTS (POSICIÓN DE LA IMAGEN) --- */

/* Por defecto (Izquierda) */
.imco-layout-left .imco-modal-content {
    flex-direction: row;
}

/* Derecha */
.imco-layout-right .imco-modal-content {
    flex-direction: row-reverse;
}

/* Arriba */
.imco-layout-top .imco-modal-content {
    flex-direction: column;
}

.imco-layout-top .imco-modal-image {
    width: 100%;
    height: 200px;
    /* Altura fija para el banner superior */
    min-height: 200px;
}

.imco-layout-top .imco-modal-forms {
    width: 100%;
}

/* Ajustes responsivos para móviles (siempre arriba) */
@media (max-width: 768px) {

    .imco-layout-left .imco-modal-content,
    .imco-layout-right .imco-modal-content {
        flex-direction: column;
    }

    .imco-layout-left .imco-modal-image,
    .imco-layout-right .imco-modal-image {
        width: 100%;
        height: 150px;
        min-height: 150px;
    }

    .imco-layout-left .imco-modal-forms,
    .imco-layout-right .imco-modal-forms {
        width: 100%;
    }
}

/* --- USER DROPDOWN MENU --- */
.imco-user-menu {
    position: relative;
}

/* Estilo inicial del submenú (oculto) */
.imco-user-menu .imco-sub-menu {
    position: absolute;
    top: 100%;
    right: 0;
    /* Se alinea a la derecha para no salirse de la pantalla */
    background: #ffffff;
    min-width: 220px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    padding: 10px 0;
    margin: 0;
    list-style: none;
    opacity: 0;
    visibility: hidden;
    transform: translateY(15px);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    z-index: 99999;
    border: 1px solid #f0f0f0;
}

/* Mostrar el submenú al hacer hover */
.imco-user-menu:hover .imco-sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Elementos de la lista */
.imco-user-menu .imco-sub-menu li {
    margin: 0;
    padding: 0;
    display: block;
    width: 100%;
}

/* Enlaces del submenú */
.imco-user-menu .imco-sub-menu li a {
    display: flex !important;
    align-items: center;
    padding: 12px 20px !important;
    color: #334155 !important;
    text-decoration: none !important;
    transition: background 0.2s ease, color 0.2s ease;
    font-size: 14px !important;
    font-weight: 500 !important;
    line-height: 1 !important;
    background: transparent !important;
}

/* Iconos del submenú */
.imco-user-menu .imco-sub-menu li a i {
    margin-right: 12px;
    font-size: 16px;
    color: #94a3b8;
    transition: color 0.2s ease;
    width: 20px;
    text-align: center;
}

/* Hover en los enlaces */
.imco-user-menu .imco-sub-menu li a:hover {
    background: #f8fafc !important;
    color: #2563eb !important;
    /* Color azul al pasar el ratón */
}

.imco-user-menu .imco-sub-menu li a:hover i {
    color: #2563eb !important;
}

/* Icono de usuario en el menú principal */
.imco-user-menu>a i,
.imco-menu-login>a i {
    margin-right: 6px;
}

/* --- ESTILOS PARA EL BOTÓN EN ELEMENTOR --- */
.imco-elementor-button {
    display: inline-block;
    font-family: inherit;
    /* Hereda la fuente de Elementor/Tema */
}

.imco-elementor-button.imco-trigger-btn,
.imco-elementor-button .imco-logged-in-btn {
    background-color: transparent;
    /* Fondo transparente para integrarse mejor */
    color: inherit;
    /* Hereda el color del texto de Elementor */
    padding: 10px 15px;
    border: none;
    cursor: pointer;
    font-weight: inherit;
    /* Hereda el grosor de la fuente */
    font-size: inherit;
    /* Hereda el tamaño de la fuente */
    transition: opacity 0.3s ease;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.imco-elementor-button.imco-trigger-btn:hover,
.imco-elementor-button .imco-logged-in-btn:hover {
    background-color: transparent;
    opacity: 0.8;
}

/* Ajustes para el menú desplegable cuando se usa el shortcode */
.imco-elementor-button.imco-user-menu .imco-sub-menu {
    top: 100%;
    right: auto;
    left: 0;
    /* Alinear a la izquierda por defecto en Elementor */
    font-family: var(--imco-font, sans-serif);
    /* Usa una fuente segura para el menú */
}

/* --- ESTILOS FORZADOS PARA EL ENLACE DEL MENÚ (HOLA, NOMBRE) --- */
.imco-user-menu>a,
.imco-menu-login>a,
.imco-menu-injected>a,
li a[href="#imco-login"],
li a.imco-trigger-btn {
    color: #ffffff !important;
    /* Fuerza el color blanco */
    font-weight: 700 !important;
    /* Fuerza la letra gruesa (Bold) */
    text-decoration: none !important;
}

/* Efecto al pasar el ratón por encima */
.imco-user-menu>a:hover,
.imco-menu-login>a:hover,
.imco-menu-injected>a:hover,
li a[href="#imco-login"]:hover,
li a.imco-trigger-btn:hover {
    color: #ffffff !important;
    opacity: 0.8 !important;
    /* Se hace un poco transparente al pasar el ratón */
}

/* Asegurar que los iconos hereden el color blanco */
.imco-user-menu>a i,
.imco-menu-login>a i,
li a[href="#imco-login"] i {
    color: #ffffff !important;
}

/* =======================================================
   ESTILOS PARA FORMULARIO INLINE (INCRUSTADO EN PÁGINA)
   ======================================================= */

.imco-inline-wrapper {
    position: relative !important;
    width: 100% !important;
    min-width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    z-index: 1 !important;
    display: block !important;
}

/* Forzar que el contenedor interno ocupe todo el ancho disponible */
.imco-inline-wrapper .imco-modal-container {
    position: relative !important;
    transform: none !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08) !important;
    margin: 0 !important;
    width: 100% !important;
    min-width: 100% !important;
    max-width: none !important;
    /* ROMPE EL LÍMITE DE 900px */
    max-height: none !important;
    border-radius: 12px !important;
    overflow: hidden !important;
    display: block !important;
}

.imco-inline-wrapper .imco-modal-content {
    max-height: none !important;
    overflow-y: visible !important;
    width: 100% !important;
    display: flex !important;
    min-height: 500px !important;
}

/* Asegurar que la imagen y el formulario se repartan el espacio 50/50 */
@media (min-width: 769px) {

    .imco-inline-wrapper .imco-layout-left .imco-modal-content,
    .imco-inline-wrapper .imco-layout-right .imco-modal-content {
        flex-direction: row !important;
    }

    .imco-inline-wrapper .imco-layout-left .imco-modal-image,
    .imco-inline-wrapper .imco-layout-right .imco-modal-image {
        flex: 1 1 50% !important;
        min-width: 50% !important;
        max-width: 50% !important;
    }

    .imco-inline-wrapper .imco-layout-left .imco-modal-forms,
    .imco-inline-wrapper .imco-layout-right .imco-modal-forms {
        flex: 1 1 50% !important;
        min-width: 50% !important;
        max-width: 50% !important;
        padding: 50px !important;
    }
}

/* Ajustes para móviles en modo inline */
@media (max-width: 768px) {
    .imco-inline-wrapper .imco-modal-content {
        flex-direction: column !important;
    }

    .imco-inline-wrapper .imco-modal-image {
        width: 100% !important;
        max-width: 100% !important;
        height: 250px !important;
        min-height: 250px !important;
    }

    .imco-inline-wrapper .imco-modal-forms {
        width: 100% !important;
        max-width: 100% !important;
        padding: 30px !important;
    }
}