/**
 * Login Gate - Estilos
 *
 * @package LoginGate
 * @version 1.0.1
 */

/* ============================================
 * BOTON FLOTANTE
 * ============================================ */

.login-gate-floating-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9000;

    display: flex;
    align-items: center;
    gap: 10px;

    padding: 15px 25px;

    background: var(--mfn-color-primary, #0095eb);
    color: #fff;

    border-radius: 50px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);

    text-decoration: none;
    font-weight: 600;
    font-size: 14px;

    transition: all 0.3s ease;
    cursor: pointer;
}

.login-gate-floating-btn:hover {
    background: var(--mfn-color-primary-dark, #0077be);
    color: #fff;
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

.login-gate-floating-btn:focus {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

.login-gate-floating-btn i {
    font-size: 20px;
}

/* Animacion de pulso para llamar la atencion */
@keyframes login-gate-pulse {
    0%, 100% {
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    }
    50% {
        box-shadow: 0 4px 25px rgba(0, 149, 235, 0.5);
    }
}

.login-gate-floating-btn {
    animation: login-gate-pulse 2s infinite;
}

.login-gate-floating-btn:hover {
    animation: none;
}

/* ============================================
 * MODAL DE LOGIN
 * ============================================ */

.login-gate-modal {
    position: relative;
    background: #fff;
    padding: 50px;
    width: 90%;
    max-width: 500px;
    margin: 20px auto;
    border-radius: 12px;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.2);
}

.login-gate-modal-inner {
    width: 100%;
}

.login-gate-modal-title {
    margin: 0 0 30px 0;
    font-size: 26px;
    font-weight: 600;
    text-align: center;
    color: #333;
}

/* Estilos del formulario */
.login-gate-form-wrapper {
    width: 100%;
}

.login-gate-form-wrapper p {
    margin-bottom: 20px;
}

.login-gate-form-wrapper label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #444;
    font-size: 14px;
}

.login-gate-form-wrapper input[type="text"],
.login-gate-form-wrapper input[type="password"] {
    width: 100%;
    padding: 14px 16px;
    margin-bottom: 0;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 16px;
    transition: border-color 0.3s, box-shadow 0.3s;
    box-sizing: border-box;
    background: #fafafa;
}

.login-gate-form-wrapper input[type="text"]:focus,
.login-gate-form-wrapper input[type="password"]:focus {
    border-color: var(--mfn-color-primary, #0095eb);
    background: #fff;
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 149, 235, 0.1);
}

.login-gate-form-wrapper .login-remember {
    margin-bottom: 25px;
    margin-top: 5px;
}

.login-gate-form-wrapper .login-remember label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: normal;
    cursor: pointer;
    margin-bottom: 0;
}

.login-gate-form-wrapper .login-remember input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.login-gate-form-wrapper input[type="submit"] {
    width: 100%;
    padding: 16px 24px;
    background: var(--mfn-color-primary, #0095eb);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s, transform 0.2s;
}

.login-gate-form-wrapper input[type="submit"]:hover {
    background: var(--mfn-color-primary-dark, #0077be);
    transform: translateY(-1px);
}

.login-gate-form-wrapper input[type="submit"]:active {
    transform: translateY(0);
}

/* Links adicionales */
.login-gate-links {
    margin-top: 25px;
    padding-top: 25px;
    border-top: 1px solid #eee;
    text-align: center;
    font-size: 14px;
}

.login-gate-links a {
    color: var(--mfn-color-primary, #0095eb);
    text-decoration: none;
    font-weight: 500;
}

.login-gate-links a:hover {
    text-decoration: underline;
}

.login-gate-links .sep {
    margin: 0 12px;
    color: #ccc;
}

/* Mensaje de error */
.login-gate-form-wrapper .alert_error {
    background: #fef2f2;
    color: #991b1b;
    padding: 14px 18px;
    border-radius: 6px;
    margin-bottom: 25px;
    font-size: 14px;
    border-left: 4px solid #ef4444;
}

/* ============================================
 * ESTILOS DE MAGNIFIC POPUP (Personalizados)
 * ============================================ */

/* Fondo del modal mas oscuro */
.mfp-bg.login-gate-mfp {
    opacity: 0.92;
    background: #1a1a2e;
}

/* Boton de cerrar personalizado */
.login-gate-modal .mfp-close {
    color: #666;
    opacity: 0.7;
    font-size: 30px;
    right: 15px;
    top: 15px;
    width: 40px;
    height: 40px;
    line-height: 40px;
    transition: opacity 0.2s;
}

.login-gate-modal .mfp-close:hover {
    opacity: 1;
    color: #333;
}

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

/* Large Desktop (>1200px) - Valores por defecto arriba */

/* Laptop (992px - 1200px) */
@media (max-width: 1200px) {
    .login-gate-modal {
        max-width: 480px;
        padding: 45px;
    }
}

/* Tablet (768px - 992px) */
@media (max-width: 992px) {
    .login-gate-floating-btn {
        bottom: 20px;
        right: 20px;
        padding: 12px 20px;
        font-size: 13px;
    }

    .login-gate-modal {
        width: 90%;
        max-width: 450px;
        padding: 35px;
        margin: 15px auto;
    }

    .login-gate-modal-title {
        font-size: 24px;
        margin-bottom: 25px;
    }
}

/* Mobile Landscape (480px - 768px) */
@media (max-width: 767px) {
    .login-gate-floating-btn {
        bottom: 15px;
        right: 15px;
    }

    .login-gate-btn-text {
        display: none;
    }

    .login-gate-floating-btn {
        padding: 16px;
        border-radius: 50%;
    }

    .login-gate-floating-btn i {
        font-size: 22px;
    }

    .login-gate-modal {
        width: 95%;
        max-width: none;
        padding: 30px 25px;
        margin: 10px auto;
        border-radius: 10px;
    }

    .login-gate-modal-title {
        font-size: 22px;
        margin-bottom: 20px;
    }

    .login-gate-form-wrapper input[type="text"],
    .login-gate-form-wrapper input[type="password"] {
        padding: 16px;
        font-size: 16px; /* Previene zoom en iOS */
    }

    .login-gate-form-wrapper input[type="submit"] {
        padding: 18px 24px;
        font-size: 16px;
    }

    .login-gate-form-wrapper label {
        font-size: 15px;
    }

    .login-gate-links {
        font-size: 14px;
    }

    .login-gate-modal .mfp-close {
        right: 10px;
        top: 10px;
    }
}

/* Mobile Portrait (<480px) */
@media (max-width: 480px) {
    .login-gate-floating-btn {
        bottom: 12px;
        right: 12px;
        padding: 14px;
    }

    .login-gate-modal {
        width: calc(100% - 20px);
        padding: 25px 20px;
        margin: 10px;
        border-radius: 8px;
    }

    .login-gate-modal-title {
        font-size: 20px;
        margin-bottom: 18px;
    }

    .login-gate-form-wrapper p {
        margin-bottom: 16px;
    }

    .login-gate-form-wrapper label {
        margin-bottom: 6px;
    }

    .login-gate-form-wrapper input[type="text"],
    .login-gate-form-wrapper input[type="password"] {
        padding: 14px;
    }

    .login-gate-form-wrapper input[type="submit"] {
        padding: 16px 20px;
    }

    .login-gate-links {
        margin-top: 20px;
        padding-top: 20px;
    }

    .login-gate-links .sep {
        display: block;
        margin: 10px 0;
        visibility: hidden;
    }

    .login-gate-links .sep::after {
        content: "";
    }

    .login-gate-links a {
        display: block;
        padding: 8px 0;
    }
}

/* Extra small (<360px) */
@media (max-width: 360px) {
    .login-gate-modal {
        padding: 20px 15px;
    }

    .login-gate-modal-title {
        font-size: 18px;
    }
}

/* ============================================
 * OVERRIDES: Login Gate específico para evitar
 * que reglas globales de Magnific Popup limiten
 * el ancho (permitir hasta 900px en desktop)
 * ============================================ */
.login-gate-modal.mfp-inline,
.mfp-content .login-gate-modal.mfp-inline {
    box-sizing: border-box;
    display: block;
    width: min(90%, 900px);
    max-width: 900px;
    padding: 50px;
}

/* Forzar que no sea limitado por .mfp-inline del tema */
.login-gate-modal.mfp-inline {
    max-width: none !important;
}

/* Ajustes móviles reforzados */
@media (max-width: 480px) {
    .login-gate-modal.mfp-inline,
    .mfp-content .login-gate-modal.mfp-inline {
        width: calc(100% - 20px) !important;
        max-width: none !important;
        padding: 20px 15px !important;
        margin: 10px !important;
    }
}

/* Strong overrides when Login Gate popup is open (más específico) */
.login-gate-mfp .mfp-content > .mfp-inline,
.login-gate-mfp .mfp-content .mfp-inline.login-gate-modal,
.login-gate-mfp .mfp-inline.login-gate-modal {
    width: min(90%, 900px) !important;
    max-width: 900px !important;
    box-sizing: border-box !important;
    display: block !important;
    padding: 50px !important;
}

@media (max-width: 480px) {
    .login-gate-mfp .mfp-content > .mfp-inline,
    .login-gate-mfp .mfp-content .mfp-inline.login-gate-modal,
    .login-gate-mfp .mfp-inline.login-gate-modal {
        width: calc(100% - 20px) !important;
        max-width: none !important;
        padding: 20px 15px !important;
        margin: 10px !important;
    }
}
